egrep \e '(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z){2,}' dict.txt
我做错了什么?字典中的单词都是小写字母。
如果 egrep
不支持间隔功能 {}
,我应该使用哪个命令?
最佳答案
你可以简单地这样做,
egrep -e '([a-z])\1+' file
示例:
$ cat file
bbar
fooohsg
jhfd
$ egrep -e '([a-z])\1+' file
bbar
fooohsg
关于regex - Bash 中字母重复的单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26065055/