Keep It Simple, Stupid | |
PerlMonks |
Re: UNO DOSby jreades (Friar) |
on Sep 13, 2000 at 03:29 UTC ( [id://32211]=note: print w/replies, xml ) | Need Help?? |
Your problem is the .*? -- although you rightly tried to limit the number of don't care characters using '?' your match still grabs the smallest number of don't care characters between '<!--' and 'DOS'... which just happens to include another '-->' and '<!--', the pieces it isn't supposed to grab. You'll need a few baselines to come up with a workable regexp:
These would help you optimize your regexp... But the key point is that you need to limit your regexp to a single comment group containing 'DOS'. I'd suggest using:
It's a little ugly, and notice that it assumes that your 'xxxx' can't contain '->', which may or may not be the case. YMMV
In Section
Seekers of Perl Wisdom
|
|