|
|
| Come for the quick hacks, stay for the epiphanies. | |
| PerlMonks |
Re^3: Inexplicably slow regexby Anonymous Monk |
| on Sep 12, 2006 at 14:52 UTC ( [id://572597]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Nothing accidental about the negation of that character class. I'm using it with a negative look-behind assertion. It's supposed to mean: "If it's not true that the preceding character is not a linebreak". So it's either a linebreak or there's nothing there at all (beginning of string).
Processing a file approximately 0.5MB in size, using gettimeofday for timing, I get First version: 0.7 seconds Second version: 0.003 seconds Third version: 0.03 seconds My actual regexes are slightly more complicated than the examples given so I see little speed difference between #2 and #3.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||