Trihedralguy has asked for the wisdom of the Perl Monks concerning the following question:

This isn't a very technical question, but I was wondering if their was a standard list somewhere with a variety of form validation regex's. I'm sure there is a perl module that will handle form validation for me, and if its simple enough I would use it (But I havent found that yet...). Anyway, like I'm saying, is there a list of regex's for like email address, alpha only, number only, remove dashes, etc?

Replies are listed 'Best First'.
Re: Regular Expressions Resource
by Your Mother (Archbishop) on Feb 23, 2008 at 22:25 UTC
Re: Regular Expressions Resource
by planetscape (Chancellor) on Feb 24, 2008 at 04:21 UTC
Re: Regular Expressions Resource
by Trihedralguy (Pilgrim) on Feb 23, 2008 at 22:40 UTC
    I'm doing a huge application a user needs to fill out, its separated in to "steps" or 6 different scripts. All I have left to do its make sure its more secure than it is now. I have also waited till the last minute to do my validation. I have Client-Side validation using a nice javascript framework, but no server-side validation (which really bad i know :), thats what im here to do!)

    Thanks for those two posts, I will look at that stuff.
Re: Regular Expressions Resource
by Trihedralguy (Pilgrim) on Feb 23, 2008 at 22:18 UTC
    When I did some past PHP programming I had used a bit of Regular Expressions". Are they they same between Perl and PHP?

      I think PHP uses pcre, which I think is a subset of Perl regexps. At the very least, they'd be similar. You can double check for differences in perlre.

      Also, there's a bunch of Regexp::Common::... modules for commonly used regexps on CPAN.

Re: Regular Expressions Resource
by Trihedralguy (Pilgrim) on Feb 24, 2008 at 02:31 UTC
    Does anyone know of any other validation modules? I'm having a hard time understanding some of these.
Re: Regular Expressions Resource
by hesco (Deacon) on Feb 25, 2008 at 07:34 UTC
    Although you say your application is nearly in place, except for the server side form data validation, I would have urged from the start your use of CGI::FormBuilder, which integrates data validation into the handling of a form in a simple object oriented tool for building, rendering and validating a cgi web form. Check it out next time. It makes for much shorter and cleaner code, generally.

    -- Hugh

    if( $lal && $lol ) { $life++; }