Matt, not only Perl can do it, but is part of the standard POSIX extended regexes (see regex(7)). Here I check for 7-letters palindromes:
perl -lne '/^(.)(.)(.).\3\2\1$/ and print' /usr/share/dict/words
grep '^\(.\)\(.\)\(.\).\3\2\1$' /usr/share/dict/words
Add a comment