Re: Phone numbers and form fields

[prev] [thread] [next] [lurker] [Date index for 2005/03/04]

From: David Cantrell
Subject: Re: Phone numbers and form fields
Date: 14:27 on 04 Mar 2005
On Thu, Mar 03, 2005 at 04:21:16PM -0500, Michael G Schwern wrote:

> I see this all the time.  Phone numbers.  Credit card numbers.  Postal codes.
> I mean, christ.  $input =~ s/\D+//g;

And many of the places where that is done, I bet it's done like this ...

if($input !~ /^\d{10}$/) {
    $input =~ s/\D+//g;
}

-- 
David Cantrell | Reality Engineer, Ministry of Information

      Eala, min Hlaforde! An æx byð on minne heafod!

Generated at 05:00 on 02 Apr 2005 by mariachi 0.52