in reply to Reasonable RegExps

Is There a better way?
These regexes should fit your criteria
my $fullname = qr/\A[a-z]{1,30}\z/i; my $username = qr/\A[a-z]\w{2,16}\z/i; my $password = qr/\A.{6,30}\z/;
Check out perlre for more info on the above regexes.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Reasonable RegExps
by demerphq (Chancellor) on May 17, 2003 at 19:12 UTC

    I think id be inclined to not use /[a-z]/i, I personally think the below is easier to read.

    my $fullname = qr/\A[[:alpha:]]{1,30}\z/; my $username = qr/\A[[:alpha:]]\w{2,16}\z/;

    TIMTOWTDI


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...