To test if the string is exactly two digits, anchor beginning and end and use a quantifier,
The !~ op negates the match so that the bracketed code is executed if $my_dat is different from two digits.if ($my_dat !~ /^\d{2}$/) { # some code here }
After Compline,
Zaxo
In reply to Re: Question on pattern matching
by Zaxo
in thread Question on pattern matching
by Joe_Cullity
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |