Think about Loose Coupling | |
PerlMonks |
Re: regex at word boundaryby davido (Cardinal) |
on Dec 07, 2005 at 18:01 UTC ( [id://514944]=note: print w/replies, xml ) | Need Help?? |
japhy correctly mentioned that $2 isn't a backreference, \2 is. But there's another problem. If you wish for such a RE to match "God dog", that one won't be selective enough to exclude non-palindromes. This is because it only fails to match if the string you're comparing doesn't have two of the same letter. For example, "Pete" would match, because it has two "e's". But "God" wouldn't match, because it doesn't have two of any particular letter in it. Dave
In Section
Seekers of Perl Wisdom
|
|