in reply to Re^7: Perl regexp matching is slow??
in thread Perl regexp matching is slow??

I don't remember saying that. If I did, I misspoke. In general, you can't do any better than to unroll the repetition: a{10000} is going to result in a 10000-state NFA.

I guess i inferred it from the discussion of construction costs earlier where you said that modern techniques avoid large construction costs.

Unicode and UTF-8, and because it does so fairly simply

Simply, unicode and regexes dont fit too well together. :-)

It is not possible to find the boundaries of an unanchored match in a single pass with a fixed amount of storage (like, say, a single start pointer and a state pointer).

Oh f**k. Thanks for straightening me out there. That makes things quite a bit trickier doesnt it?

True, but you can portably index into it if you use char & 0xFF, which is what the code does.

Ah right. Again thanks. I wasnt trying to be an arse by mentioning that btw, (although i ended up looking like one), its something that has come up quite a few times in the perl engine, so i thought it was just another example of an easy error to make. Should have expected someone as knowledgable as yourself to have considered it already. Sorry.

---
$world=~s/war/peace/g