http://www.perlmonks.org?node_id=38153


in reply to How to efficiently return the set of REGEX expressions matching 1 line of input?

Actually, davorg didn't miss the point. What he did was answer your question. If the specs are not clear, the answers won't be, either.

To get a better answer to your question, post to Seekers of Perl Wisdom. Include some sample code, sample lines from the file, and some of the regexes.

If your concern is speed, you'll need to learn about regex optimization. If you are iterating over lines in a file and iterating over hundreds of regexes, you may wish to reconsider how you are processing your data if speed is a consideration. Heck, if your data isn't clean and you have just one bad regex, your program may never finish running. For an example of some of the problems involved with regex optimization, read Death to Dot Star!.

Restating your problem and asking for optimization advice may help.