Front page | perl.beginners |
Postings from February 2002
Re: reg exp question
Thread Previous
From:
Frank
Date:
February 7, 2002 04:31
Subject:
Re: reg exp question
Message ID:
20020207123135.GH7482@fysh.org
On Thu, Feb 07, 2002 at 12:17:42PM +0000, 'Perl wrote:
>
> /^(6565\d{12})|(555[10]00\d{10})/
>
> Perhaps..
>
> not tested mind.
evidently..
/^(6565\d{12})|(555[10]\d{12})/
will manage numbers in the range 555000-555199, not ideal
/^((6565\d{2})|(555(0\d{2})|(100))\d{10})/
will manage the right range, I think.
(6565\d{2}) will match 6 numbers
as will (555 ..
(0\d{2}) matches 000-099
(100) matches 100
)
\d{10} grab the remainder.
--
Frank Booth - Consultant
Parasol Solutions Limited.
(www.parasolsolutions.com)
Thread Previous