Perl Monk, Perl Meditation | |
PerlMonks |
Re: Inefficient regexby sutch (Curate) |
on Mar 05, 2003 at 18:40 UTC ( [id://240652]=note: print w/replies, xml ) | Need Help?? |
This: (.*?)\s*(.*?)\s* can be problematic. Since LABEL and PARAMETER must not contain spaces, try replacing that portion with something like: ([^\s]+)\s+([^\s]+)? I'd also suggest that you change *? to simply *, since * denotes 0 or more occurances.
Probably the biggest problem is the: You may also want to take a look at the book "Mastering Regular Expressions" by Jeffrey E. Friedl. See Mastering Regular Expressions for a review.
In Section
Seekers of Perl Wisdom
|
|