[Issue 11839] New: std.regex capture group names should allow numbers to be in them

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 28 15:54:44 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11839

           Summary: std.regex capture group names should allow numbers to
                    be in them
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: tcdknutson at gmail.com


--- Comment #0 from Dylan Knutson <tcdknutson at gmail.com> 2013-12-28 15:54:38 PST ---
Given a regex like this:

---
import std.regex;

void main()
{
    auto r = regex(`(?P<var1>\w+)`);
}
---

std.regex will throw this exception: 

std.regex.RegexException at std\regex.d(1990): Expected '>' closing named group
Pattern with error: `(?P<var1` <--HERE-- `>\w+)`
Pattern with error: `(?P<var1` <--HERE-- `>\w+)`

Changing var1 to varone doesn't result in an error. 

Perl allows capture group names to contain numbers, just not start with them,
and I think it makes sense to follow this example.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list