in reply to Re^4: How to enter a MAC address
in thread How to enter a MAC address
I think that /\x/ will only guarantee you that you have 1 hex digit in your string, though won't work. If you want to make sure there are exactly 2 hex digits, use something like:
-validatecommand => sub{$_[0] =~ /^[0-9a-f]{2}$/i},
The ^ matches the beginning of the line, the $ matches the end, and the {2} matches exactly 2 hex digits (0-9 or a-f). The i at the end causes ignoring of case, of course.
Check perlre if you need to read up on regexes. Good luck!
|
|---|