On Friday, July 25, 2003, at 10:06 PM, Alex Rice wrote:

"perlRegEx = 13, PNLP = 3" using:

put "<perl>(.*)(</perl>)" into regEx

I wonder if--by one making a few assumptions--this can be optimized.

The ".*" is the most general pattern and so it's the worst, performance wise. By restricting the pattern a bit we can speed it up. Using Mark's test case with "<perl>([^<]+)(</perl>)" the run-times are almost identical.

now I get this for 5000 repeats:

perlRegEx = 29, PNLP = 28

cool!

Reply via email to