We don't bite newbies here... much | |
PerlMonks |
Re: Re: pattern matchingby perlcgi (Hermit) |
on May 04, 2004 at 13:59 UTC ( [id://350338]=note: print w/replies, xml ) | Need Help?? |
Be careful using .* as it is one greedy mother. The first .* will swallow everything up to the second last // in your regex. So if your source text ever happens to have three or more sets of // on a line you regex will fail. Better to use nongreedy, minimal matching using .*? This is probably so obvious to an expert like Corion, he didn't bother mentioning it. I mention it 'cos the OP states that the regex seems to work.
In Section
Seekers of Perl Wisdom
|
|