in reply to Re^4: Regex help
in thread Regex help

(?!\w) and (?=\W) differ at the end of the string.

(?<=\w) and (?<!\W) differ at the start of the string.

Replies are listed 'Best First'.
Re^6: Regex help
by pKai (Priest) on Jan 16, 2006 at 10:27 UTC

    Oh, I was vaguely aware of it. But I didn't realize that that was the exact point japhy addressed!

    [\b ]*this*, [(?:(?=\w)(?<!\w)|(?=\W)(?<!\W))]*this*, [(?:(?<=\w)(?!\w)|(?<=\W)(?!\W))]this*,* [(?(?=\w)(?<!\w)|(?<!\W)) ]*this*, [(?(?<=\w)(?!\w)|(?!\W)) ]*this*,* [(?:(?=\w)(?<!\w)|(?!\w)(?<=\w))]*this*, [\b ],*that* [(?:(?=\w)(?<!\w)|(?=\W)(?<!\W))]*,*that [(?:(?<=\w)(?!\w)|(?<=\W)(?!\W))],*that* [(?(?=\w)(?<!\w)|(?<!\W)) ]*,*that* [(?(?<=\w)(?!\w)|(?!\W)) ],*that* [(?:(?=\w)(?<!\w)|(?!\w)(?<=\w))],*that*