HiFoo has asked for the wisdom of the Perl Monks concerning the following question:
if ( $string =~ /[0-9a-fA-F]+/ ) { # valid number } else { # not valid number }
After reading input validation docs ( especially the ones concerning email address validation ) I get the feeling that there is probably a better way to do this. Any ideas?
Thanks
HiFoo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Validating Hex Numbers
by kal (Hermit) on Jan 08, 2003 at 22:20 UTC | |
|
Re: Validating Hex Numbers
by bart (Canon) on Jan 08, 2003 at 22:46 UTC | |
|
Re: Validating Hex Numbers
by ihb (Deacon) on Jan 09, 2003 at 02:35 UTC | |
|
Re: Validating Hex Numbers
by jmcnamara (Monsignor) on Jan 08, 2003 at 23:35 UTC | |
|
Re: Validating Hex Numbers
by PodMaster (Abbot) on Jan 08, 2003 at 22:36 UTC | |
by seattlejohn (Deacon) on Jan 09, 2003 at 01:11 UTC | |
|
Re: Validating Hex Numbers
by diotalevi (Canon) on Jan 08, 2003 at 22:27 UTC |