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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: To find, this not preceded by that, use (?<!pattern)(?!pattern) (or not)
by Anonymous Monk on Dec 13, 2011 at 15:33 UTC | |
|
Re^2: To find, this not preceded by that, use (?<!pattern)(?!pattern) (or not)
by Anonymous Monk on Dec 13, 2011 at 15:08 UTC |