I like your idea. That could be very useful. You could try it with something like PPI. That is what Perl::Critic uses.
Update: Link fixed.
In reply to Re^6: Problem using value of variable in a regular expression
by kejohm
in thread Problem using value of variable in a regular expression
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |