Perl-Sensitive Sunglasses | |
PerlMonks |
Re^3: regex at word boundaryby QM (Parson) |
on Dec 07, 2005 at 21:07 UTC ( [id://515042]=note: print w/replies, xml ) | Need Help?? |
You're right, the (corrected) code won't find palindromes. It wasn't intended to. It was the first step in finding a palindrome candidate.OK, fair enough. So what did you want it to do? Did you just want to check for repeated characters at the proper end of word boundaries? [Insert "Lightbulb Over Head" graphic here ] You just want a filter to grab candidates, then strip whitespace, then test for palindrome-ness. I think you'd do us a favor by coming up with an appropriate regex with ??{code}, something near: Though I don't think that works, and it's untested. (Hey, I have to leave something up to you.) Besides, there's a lot left out of the perlre with ?{code} and ??{code}, so please come back and tell us what it should say :) -QM
In Section
Seekers of Perl Wisdom
|
|