Finding the intersection between two regexes
David Cantrell
david at cantrell.org.uk
Fri Apr 25 15:09:27 BST 2014
On Fri, Apr 25, 2014 at 07:38:55AM +0200, Abigail wrote:
> On Fri, Apr 25, 2014 at 12:47:04AM +0100, David Cantrell wrote:
> > 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.
> > 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.
> I'm with Mark. My view is that a /\d/ is almost always wrong, on any perl
> released in this century.
I'll accept patches from you too :-)
--
David Cantrell | Official London Perl Mongers Bad Influence
I'm in retox
More information about the london.pm
mailing list