Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Matching Exact Wordby jonadab (Parson) |
on Oct 09, 2014 at 11:01 UTC ( [id://1103283]=note: print w/replies, xml ) | Need Help?? |
This will fail in some cases. Geographically, Guinea is thousands of miles from here. (This fails immediately because of the comma; if the comma were removed, it would still fail.) If what you want is to match Guinea but not New Guinea or Equatorial Guinea, then what you probably really want is a negative lookbehind assertion that specifically rules out being preceded by "New " or "Equatorial ". Similarly, a negative lookahead assertion at the end can preclude Guinea Pig and Guinnea-Bisseau.
In Section
Seekers of Perl Wisdom
|
|