The (?<!bar) in your "solution" does nothing. s/\b((?!bar)\S{3,})/\U$1/g behaves the same. The only way for (?<!bar) to matter is due to \b caring about \w vs \W not about \s vs \S. \b\w{3,} would imply (?<!\w) which implies (?<!bar).
I can't tell what you are actually trying to solve so I don't have much else to offer. Would "foobar" be "\S{3} not preceded by 'bar'"? Is that what you are trying to find?
- tye
In reply to Re: To find, this not preceded by that, use (?<!pattern)(?!pattern) (or not)
by tye
in thread To find, this not preceded by that, use negative look-behind with negative look-ahead , use (?<!pattern) with (?!pattern), (?<!pattern)(?!pattern)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |