Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Re: Validating Numbers in CGI Script?

by dha (Acolyte)
on May 11, 2001 at 03:08 UTC ( #79601=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://79601]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2022-05-17 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (65 votes). Check out past polls.

    Notices?