Your skill will accomplish what the force of many cannot |
|
PerlMonks |
WARNING merlyn wrote BAD CODEby Ovid (Cardinal) |
on Jul 27, 2000 at 22:55 UTC ( [id://24729]=note: print w/replies, xml ) | Need Help?? |
Okay, the title is kind of a joke. It's just a good-natured tweak at merlyn for the brouhaha over his WARNING t0mas wrote BAD CODE node that generated so much flak. No offense intended :)
merlyn's code was bugging me, but I couldn't quite put my finger on it. My problem was that the dot metacharacter is so indiscriminating that it will match anything. However, I simply assumed that if merlyn posted the code, it must work. His code is great if you're checking for C-style comments that begin and end in something like /* comment here */ or "? comment here ?". But if you read my post, that's not what we were checking for:
The first regex will print matched <def"g"hi>. The second will print matched <hi>. No disrespect is intended towards Randal as he was right in pointing out that my first regex was broken.
Cheers,
In Section
Meditations
|
|