in reply to Regex runs for too long

According to perlfunc, study may or may not help you out on lengthy regular expressions. I tried it once on a huge set of regex'es (piles and piles of text), and it did make it somewhat faster as far as I can tell. You may want to give that a shot both with and without, to see if it's possible to pick up any speed on it.

It's not a great algorithmic trick like some of the shrewd monks before me have suggested, but it may be able to add to those solutions with it's pre-indexing. A more detailed explaination of it's organization can be found on the link above. Good luck !

--jay