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

Re: reg exp question

Thread Previous | Thread Next
Jeff 'japhy' Pinyan
February 7, 2002 08:44
Re: reg exp question
Message ID:
On Feb 7, Stuart Clark said:

>How do I match a pattern that starts with a 4 and has 16 numbers in it.
>I try /^4\d{16}/;

That's quite vague.  Do you mean the string must start with a 4 and
consist ONLY of 16 digits?


>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

Again, you put \d{16} after you already matched some numbers.


Jeff "japhy" Pinyan
RPI Acacia brother #734
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About