in reply to Can't match negated words.
prints 'Opening extended comment' but does not for the line/* sdfthrow OtherException
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.throw new Exception() /* asdfasdf
Is my understanding this expression correct? Would folks mind if I explain what I think is going on from left-right?if ($line =~ /^.*\/\*((?:(?<!throw)).*$/ ) { debug("Opening extended comment"); }
/^ 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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Can't match negated words.
by Abigail-II (Bishop) on Jun 24, 2004 at 15:19 UTC | |
by perlgags78 (Acolyte) on Jun 24, 2004 at 15:29 UTC | |
by Abigail-II (Bishop) on Jun 24, 2004 at 16:03 UTC | |
Re^2: Can't match negated words.
by Roy Johnson (Monsignor) on Jun 24, 2004 at 15:24 UTC |