I would instead specify what is allowed, which makes for a simpler regular expression in your case:
if($view_tag =~ m/\A[A-Za-z0-9][A-Za-z0-9_\-\.]+\z/) { # everything is OK } else { die "Invalid/disallowed filename '$view_tag'"; };
In reply to Re: Regex to detect file name
by Corion
in thread Regex to detect file name
by lirc201
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |