Yup, there are ways to improve:
$cmd =~ /[.!+=[\]*<>$%@?&:\/\\{}]/g # also possible but I prefer the alternative above $cmd =~ /[].!+=[*<>$%@?&:\/\\{}]/g
-- Hofmator
In reply to Re: regex optimization
by Hofmator
in thread regex optimization
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |