Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: ?Homework alert! Re: validating string length with a regular expression

by buckaduck (Chaplain)
on Mar 18, 2002 at 18:16 UTC ( #152544=note: print w/replies, xml ) Need Help??

in reply to •Homework alert! Re: validating string length with a regular expression
in thread validating string length with a regular expression

<wild speculation>

Although it's not my question, I can imagine a situation where someone is validating a set of variables which contain user-supplied data. A simple design for validating them might involve a hash table which correlates each data type to an "allowable" regex pattern.

Not that there aren't ways around this (perhaps using subroutines instead of regexes). But I'll admit that I've done it before, cramming a lot of data validation into a single regex for this purpose.

</wild speculation>

Update: I'm good. But I'm slow. Ah, well...


Replies are listed 'Best First'.
Data::FormValidator [was Re: ?Homework alert! Re: validating string length with a regular expression]
by jehuni (Pilgrim) on Mar 18, 2002 at 18:26 UTC

    Bull's eye!

    Anyway, this is my first experience with Data::FormValidator (formerly HTML::FormValidator, I believe). It seems to do what I want, but if anyone has any other recommendations for a generic sort of input validation module, please share. My use of Data::FormValidator is based partly on a Super Search of perlmonks, so I'd love to hear of any other possibilities that I may have overlooked.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2022-11-29 22:13 GMT
Find Nodes?
    Voting Booth?