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


in reply to Can't match negated words.

Hi folks, Thanks for pointing that out Hugo. I'm currently trying to extend it so that for the line
/* sdfthrow OtherException
prints 'Opening extended comment' but does not for the line
throw new Exception() /* asdfasdf
Basically so long as the '/*' hasn't been preceeded with a throw then it should print out opening the comment. I've got the following expression in place.
if ($line =~ /^.*\/\*((?:(?<!throw)).*$/ ) { debug("Opening extended comment"); }
Is my understanding this expression correct? Would folks mind if I explain what I think is going on from left-right?

/^ matches the start of the $line string

.* says that the start can be proceeded by any number of characters

\/\* matches the '/*' string

(?:(?<!throw)) means so long as /* isn't preceeded in the string by the word throw $line still matches

.*$ means that any number of characters can proceed the /* upto the end of the line

My understanding's obviously incorrect cos eh.. it don't work for a lad. Any help would be greatly appreciated, Mark.