in reply to Re: Backtracking problem with .*(?!bar)
in thread Backtracking problem with .*(?!bar)
Many thanks to both of you !
This had me flummoxed for quite some time.
For my understanding:
Abigail's answer reads
Beginning of line, followed any number of times by anything that isn't preceded by "system",
follwed by an end of line marker
and BrowserUK's reads:
Beginning of line not followed by anything that is followed by "system"
In both cases, I assume that it is the presence of begin/end line qualifiers that stops the regex
from backtracking and matching any as .*(?!system) does.
Shame an Initiate can't at least cast one vote :(
This had me flummoxed for quite some time.
For my understanding:
Abigail's answer reads
Beginning of line, followed any number of times by anything that isn't preceded by "system",
follwed by an end of line marker
and BrowserUK's reads:
Beginning of line not followed by anything that is followed by "system"
In both cases, I assume that it is the presence of begin/end line qualifiers that stops the regex
from backtracking and matching any as .*(?!system) does.
Shame an Initiate can't at least cast one vote :(
In Section
Seekers of Perl Wisdom