[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: simple grep command twister



john smith scripsit:
>Hi!
>  mind twister break?
>how to use grep to show all the paladrome words in the linux dictionary?
>
>grep '\(.\)\(.\)\(.\)\3\2\1' \usr\dict\words partly works?

You simply can't. period. palindrome (not palandrome) is a
context-free concept, that is to say you can't express it with regular 
expression. See any good book on compilers or better still forma
languages to understand why.

-- 
Leo "TheHobbit" Cacciari

I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This email was infected under the terms of the GNU General Public
License.



Reply to: