in reply to Re^2: reg ex NOT
in thread reg ex NOT
Aye, the construct I posted needs to be anchored (but not necessarily using ^ and $). It may be a waste to use that construct for single characters, but it's useful (necessary) for the use I described in my original post (i.e. To matche a sequence of characters that does not contain anything that matches a specified regexp). For example,
/<table>(?:(?!<\/table>).)*<\/table>/
(Not the best example, cause tables can be nested in HTML and for other reasons, but you get the idea.)
|
---|
In Section
Seekers of Perl Wisdom