This is very nice, but this works well with terms, not that well with regular expressions (ie, not 'foo' but something like 'f[o|O]{1,3}' instead).
Also, this solves little because this only tells me that
my line matches one of my patterns.. that is great, but the problem here is finding WHICH re it matches.
I look at your answer, and I think I'm not clever enough to extend this kind of idea to those requirements.
And another thing, how flexible and scalable are perl's res, what happens when there's 1000s of ~40 chars long REs ganged together, will regexp engine/optimizer sort through that?