Welcome to the Monastery | |
PerlMonks |
Re: regex at word boundaryby mikeraz (Friar) |
on Dec 07, 2005 at 22:06 UTC ( [id://515060]=note: print w/replies, xml ) | Need Help?? |
I reviewed the link that swkronenfeld provided. The code samples, or at least as many as I waded through, did not find palindromes. The found mirror strings. I prefer pi is a palindrome. aaabbcbbaaa is not a palindrome. After writing to steele1381 and QM about intent and all that I decided I'd better step up and show the code. I believe this word end searching should be faster than a pure regex version but have not tested it yet. Here's the trivial program I wrote to take a text file and locate all the palindromes. Note: it's trivial and should be easy to break. In particular the punct filter is incomplete, HTML will break it . . .
Be Appropriate && Follow Your Curiosity
In Section
Seekers of Perl Wisdom
|
|