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


in reply to Composing regex's dynamically

I was going to suggest Regex::PreSuf, but when searching for that, I found Regexp::Assemble. That seems like exactly what you're looking for...

(Although Corion's suggestion should work just fine, too, if you're just alternating strings...)


Mike