Note that replying to a 12 year old post with a new question is unlikely to get you many responses; better to post a new question in Seekers of Perl Wisdom, of course keeping in mind How do I post a question effectively?
But it sounds to me like what you want to do is this: Building Regex Alternations Dynamically.
In reply to Re^5: Using variables in regex search
by haukex
in thread Using variables in regex search
by lancer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |