The problem occurs due to the fact that your pattern does not match Cyrillic о
and а
, and because you use a POSIX ERE pattern without the -E
option.
You can use
grep -Eo '[gг][vв][oо][?жz](dj|[d??])[aа]' filename
Using s*
does not actually make sense as it only matches zero or more whitespace chars (only in GNU grep
).
I added -o
option here to output all matches, not just matched lines.
See the online grep demo.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…