in reply to Re^2: Matching Exact Word
in thread Matching a Word Exactly
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching Exact Word
by Jim (Curate) on Oct 09, 2014 at 18:33 UTC | |
|
Re^2: Matching Exact Word
by kzwix (Sexton) on Oct 09, 2014 at 11:20 UTC |