in reply to Re: Re: Validating Numbers in CGI Script?
in thread Validating Numbers in CGI Script?

Of course, if you're going to use a regex(p), you might as well make it easy on yourself:

use Regexp::Common;

if ($thing =~ /^$RE{num}{dec}$/) {
    ...
}

(this particular example, of course, requires DWIM.pm... :-)

dha

  • Comment on Re: Re: Re: Validating Numbers in CGI Script?

Replies are listed 'Best First'.
Re: Re: Re: Re: Validating Numbers in CGI Script?
by japhy (Canon) on May 11, 2001 at 03:51 UTC
    I'm in favor of the user knowing what the regex does, before using some pre-packaged regex. No offense to Damian, of course, but I'd rather know what my regex does exactly. That said, some interested party could read the module's source.

    japhy -- Perl and Regex Hacker