|Perl Monk, Perl Meditation|
Re: Can't match negated words.by perlgags78 (Acolyte)
|on Jun 24, 2004 at 14:58 UTC||Need Help??|
Hi folks, Thanks for pointing that out Hugo. I'm currently trying to extend it so that for the line
prints 'Opening extended comment' but does not for the line
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.
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.