in reply to Re-define Word Boundary?

If I recall, a \b word boundry is synonymous to, or defined as follows:

/(?: (?<!\w)(?=\w) | (?<=\w)(?!\w) )/x

That means that you can create your own version using zero-width lookahead and lookbehind assertions along with character classes.

You may have a look at the entire Why do zero width assertions care about lookahead/behind? thread for further discussion on the \b metacharacter and zero-width assertions.


Dave


"If I had my life to live over again, I'd be a plumber." -- Albert Einstein