Re: Regular Expression for a UK Mobile

From: Date: Fri, 15 Oct 2004 12:08:02 +0000
Subject: Re: Regular Expression for a UK Mobile
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199579@lists.php.net to get a copy of this message
On Friday 15 October 2004 19:38, Shaun wrote: > Could anyone help me with a reugular expression for a UK mobile phone > number? > > So far I have tried this but with no success > > <snip> > $regexp = "/^447[0-9]{9}$/"; > if(!preg_match( $regexp, $_POST[mobile_number] )){ > $error = "Invalid Mobile Number"; > </snip> > > The number nust be 11 numbers long, be all numbers, have no spaces and > begin with 447. 11 minus 3 = 8? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* When nothing can possibly go wrong, it will. */

« previous php.general (#199579) next »