develooper Front page | perl.beginners | Postings from February 2002

Re: reg exp question

Thread Previous | Thread Next
From:
Frank
Date:
February 7, 2002 04:17
Subject:
Re: reg exp question
Message ID:
20020207121742.GG7482@fysh.org
On Thu, Feb 07, 2002 at 11:10:14PM +1100, Stuart wrote:
> How do I match a pattern that starts with a 4 and has 16 numbers in it.
>  
> I try /^4\d{16}/;

If it consists of 16 numbers try:
/^4\d{15}/; 

> Also  how do I match a 16 digit number that starts with either 6565 or
> starts with a number in the range of  555000-555100
>  
>  
> /(^6565(\d{16})|^{555000-555100}(\d{16}))/
---end quoted text---

/^(6565\d{12})|(555[10]00\d{10})/

Perhaps..

not tested mind.

-- 
 Frank Booth - Consultant
Parasol Solutions Limited.
(www.parasolsolutions.com)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About