Skip Menu |

This queue is for tickets about the re-engine-RE2 CPAN distribution.

Report information
The Basics
Id: 69299
Status: open
Priority: 0/
Queue: re-engine-RE2

People
Owner: Nobody in particular
Requestors: DOHERTY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Named captures unavailable in %+
The following test script fails when I wouldn't expect it to. %+ should be holding the named captures, even when the RE2 engine is used. #!/usr/bin/env perl use strict; use warnings; use Test::More; use re::engine::RE2; my $re1 = qr/(?<name>foo)/; my $re2 = qr/(?P<name>foo)/; my $string = 'abcdefoo'; { ok !$re1->isa('re::engine::RE2'), q{Perl's regex engine used}; ok $string =~ $re1, 'regex matches'; ok $1, 'match extracted'; is $1, 'foo', 'match is correct'; ok $+{name}, 'named match extracted'; is $+{name}, $1, 'named matches numbered'; } { ok $re2->isa('re::engine::RE2'), q{RE2 regex engine used}; ok $string =~ $re2, 'regex matches'; ok $1, 'match extracted'; is $1, 'foo', 'match is correct'; ok $+{name}, 'named match extracted'; is $+{name}, $1, 'named matches numbered'; } done_testing;
Subject: Re: [rt.cpan.org #69299] Named captures unavailable in %+
Date: Sat, 9 Jul 2011 15:44:10 +0100
To: bug-re-engine-RE2 [...] rt.cpan.org
From: David Leadbeater <dgl [...] dgl.cx>
On the todo list, haven't got around to it yet.