Finding the intersection between two regexes
David Cantrell
david at cantrell.org.uk
Fri Apr 25 00:47:04 BST 2014
On 24/04/2014 23:28, Mark Fowler wrote:
> On Thursday, April 24, 2014, Michael Lush <mjlush at gmail.com> wrote:
>
> if ($x =~ /^246[2-9]\d{6}$/ and $x =~
>> /^246(?:(?:2[346]|45|82)\d|25[0-4])\d{4}$/ )
>
> Those /d are incorrect. You want [0-9] or to use the /a regexp flag on a
> suitably modern perl.
https://code.google.com/p/libphonenumber/source/browse/trunk/resources/PhoneNumberMetadata.xml
My regexes come directly from Google's libphonenumber. They are happy to
accept patches provided you sign your life away in blood. I require no
such blood sacrifice for my code, but do insist that the tests still
pass on perl 5.8.8.
https://github.com/DrHyde/perl-modules-Number-Phone
Assuming that you actually care, and aren't just pedanting in the finest
custom of this august group, of course :-)
--
David Cantrell | top google result for "internet beard fetish club"
Nuke a disabled unborn gay baby whale for JESUS!
More information about the london.pm
mailing list