This will remove all illegal characters, then complain if what's left is outside of the desired size range.$my_var =~ s/[^a-zA-Z0-9_@#$%]//g; print "Bad length!" unless (length $my_var >= 8) && (length $my_var <= + 12);
In reply to Re: pattern matching with specified length
by dsheroh
in thread pattern matching with specified length
by tariqahsan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |