Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
... locates the word 'hello' then if the rest of the string ... This is your first problem: a lookahead peeks into the string, but doesn't change the position that the rest of the string will attempt to match at. You don't want a lookahead for this, but a straight match - then the rest of the pattern will correctly be tried against the rest of the string:
... if the rest of the string DOES NOT contain the char 'G' followed by the char 'a' ... A simple negative lookahead:
So your specification is satisfied simply by:
Hope this helps, Hugo In reply to Re: Debugging Regexes
by hv
|
|