Are you running in 'taint' mode? If not, this would be a good place to start with this kind of code. In this case, you'd have to sanitize the regex manually and then untaint it.
If you're not familiar with taint mode, check out http://perldoc.perl.org/perlsec.html.
In reply to Re: how to restrict a regexp?
by wade
in thread how to restrict a regexp?
by tfoertsch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |