regex matching exactly 10 digits
- From: "jtbutler78@xxxxxxxxxxx" <jtbutler78@xxxxxxxxxxx>
- Date: 28 Nov 2006 05:58:09 -0800
I am having an issue trying to match exactly 10 digits. I want to
append a '1' in front of 10 digit fax numbers. Numbers longer than 10
digits leave alone. I am using \d{10,10} match at least and at most 10
digits but it still appends a 1 to international numbers. I am missing
something but I am not sure what.
#strip out unneeded chars
$fax_num =~ s/[\s()-]//g;
#append 1 to 10 digit fax number
$fax_num =~ s/(\d{10,10})/1$1/;
.
- Follow-Ups:
- Re: regex matching exactly 10 digits
- From: John W. Krahn
- Re: regex matching exactly 10 digits
- From: Mr P
- Re: regex matching exactly 10 digits
- From: Paul Lalli
- Re: regex matching exactly 10 digits
- Prev by Date: Re: Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema
- Next by Date: FAQ 2.1 What machines support perl? Where do I get it?
- Previous by thread: Translating RAD-50 code
- Next by thread: Re: regex matching exactly 10 digits
- Index(es):
Relevant Pages
|