grep/regex can't find accented word

后端 未结 5 2003
抹茶落季
抹茶落季 2021-01-18 20:41

I\'m trying mount a regex that get some words on a file where all letters of this word match with a word pattern.

My problem is, the regex can\'t find accented words

5条回答
  •  执笔经年
    2021-01-18 21:29

    Try as @dule said, but with LANG=en_US.iso88591:

    cat input/words.txt | LANG=en_US.iso88591 grep '^[éra]\{1,4\}$' > output/words_era.txt
    

提交回复
热议问题