Looking for a perl one-liner what will find all words with the next pattern:
X(not_X_chrs)X(not_X_chrs)X e.g. cyclic
For one character, it is easy, e.g. for ‘a’
perl -nle 'print if /^a[^a]+a[^a]+a$/' < /usr/share/dict/web2
but I want search for ANY character, so, looking for one regex for finding all words like:
azalea #repeating a
baobab #repeating b
cyclic #c
and so on..
tried this:
perl -nle 'print if m/^([a-z])[^$1]+$1[^$1]+$1$/i' </usr/share/dict/web2
but not works.
is to
as
is to
so you could use