in reply to Analyzing regular expression performance
update: one example: perl -MYAPE::Regex::Explain -e 'print YAPE::Regex::Explain->new(qr/(<a\s(?:[^>](?!href))*href\s*)(&(&[^;]+;)?(?:.(?!\3))+(?:\3)?)([^>]+>)/)->explain'
For the performance, one thing that comes to my mind is the /o qualifier to compile once only. And if You still suffer from perfomance issues, You might want to use a debugger and/or profiler. But in that case, maybe You should first try to 'divide and conquer' the regexp into a few smaller ones.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Analyzing regular expression performance
by duff (Parson) on May 12, 2006 at 18:37 UTC | |
by mantadin (Beadle) on May 12, 2006 at 22:51 UTC | |
by duff (Parson) on May 13, 2006 at 04:32 UTC |