in reply to Backtracking hurts: slow regexp

Perl uses internally an engine that's based on NFA. It is possible to change this into a DFA, but that would require you to write a different regexp engine - all perl currently provides is a mechanism to hook in a different regexp engine.

As for optimizing your regexp, I do not know if that's possible. I do not know what the regexp is supposed to do. Sure, I can read the regexp, and I know what it does, but if I change anything about it, it will do something else. Which may still do the task you want it to do, but since you don't tell us, I'm not going to guess.

Tell us, what's the data you are applying it against, and what you want to match?