User Tools

Site Tools


grep_usage

dummy

wordscapes

tags | word scape

% grep -i "^[slev][slev][slev][slev]s$" /usr/share/dict/american-english 
elves
sells

repeat previous character N times

Use (character){N} and call grep with -E

 % grep -Ei "^[enrich]i([enrich]){2}e$" /usr/share/dict/american-english
Circe
niche
niece

is equivalent to

 % grep -i "^[enrich]i[enrich][enrich]e$" /usr/share/dict/american-english
Circe
niche
niece

Another example:

 % grep -Ei "^([dunes]){2}u([dunes]){2}d$" /usr/share/dict/american-english
unused
grep_usage.txt · Last modified: 2021/04/08 10:04 by raju