gautamparimoo has asked for the wisdom of the Perl Monks concerning the following question:
Hi. I have the specification to build the following numeric string: 981890or981891 followed by 10 digits or atmost 4 seperators(.,-,:)+ 10 digits. So the example matching this should be: 1. 9818902365894598 2.9818 9021 2454 2170 3.9818-9145-6896-2146 The regex I am trying is as follow:
9818[\D]?9[0|1][\D]?\d{2}[\D]?\d{4}[\D]?\d{4}
But this looks inefficient. Please suggest:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regex Help
by davido (Cardinal) on Mar 25, 2013 at 08:28 UTC | |
by gautamparimoo (Beadle) on Mar 25, 2013 at 08:48 UTC | |
by davido (Cardinal) on Mar 25, 2013 at 08:55 UTC | |
by gautamparimoo (Beadle) on Mar 25, 2013 at 09:29 UTC | |
by Anonymous Monk on Mar 25, 2013 at 10:17 UTC | |
| |
Re: Regex Help
by hdb (Monsignor) on Mar 25, 2013 at 08:10 UTC | |
Re: Regex Help
by Anonymous Monk on Mar 25, 2013 at 07:55 UTC | |
Re: Regex Help
by AnomalousMonk (Archbishop) on Mar 25, 2013 at 19:19 UTC |
Back to
Seekers of Perl Wisdom