http://qs321.pair.com?node_id=370249

perlgags78 has asked for the wisdom of the Perl Monks concerning the following question:

Hi folks, Is there anyway to debug regular expressions?
I have a regex that resolves a lookahead expression at
the beginning of the expression. It looks like the
following
( "hello Gags" =~ /^(?=hello).*[^G][^a].*$/ )&& print ("Matched") || p +rint ("Unmatched")
Basically what it's saying is that if the engine looks
ahead from the start and locates the word 'hello'
then if the rest of the string DOES NOT contain the
char 'G' followed by the char 'a' then print matched or
else print unmatched.
i.e. for the above string it should return Unmatched... but
it doesn't.

Would anyone be able to tell me what the internal string
changes to after the engine reads (?=hello) and actually
locates the first hello?
Is there anyway to debug the resolution of regexes? I'm
using the debugger but it only does statements at a time.

Thanks,
Mark.