Welcome to the Monastery | |
PerlMonks |
Re^2: Matching Exact Wordby kzwix (Sexton) |
on Oct 09, 2014 at 11:20 UTC ( [id://1103285]=note: print w/replies, xml ) | Need Help?? |
You are right. However, even this code may fail, if somebody misspells the country names. It is more a linguistic problem than a pattern recognition one, and, as such, seems extraordinary difficult to tackle in a failproof way (which would require an AI, a syntaxic and contextual analysis, etc.) However, as you mentioned, using negative look-ahead and negative look-behind assertions should allow him to avoid the most common other words.
In Section
Seekers of Perl Wisdom
|
|