www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: tcdknutson gmail.com


--- Comment #0 from Dylan Knutson <tcdknutson 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 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: -------
Dec 28 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11839


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |dmitry.olsh gmail.com
         AssignedTo|nobody puremagic.com        |dmitry.olsh gmail.com


--- Comment #1 from Dmitry Olshansky <dmitry.olsh gmail.com> 2014-01-06
07:56:42 PST ---
https://github.com/D-Programming-Language/phobos/pull/1838

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 06 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11839



--- Comment #2 from github-bugzilla puremagic.com 2014-01-07 10:43:44 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/a673d01ee90f56adb6d73aae05ab0ab74d08baf7
fix issue 11839

https://github.com/D-Programming-Language/phobos/commit/2648a68e9adbdbb9bf21b13dfe655bacbc61cb1e
Merge pull request #1838 from blackwhale/issue-11839

Fix issue 11839

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 07 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11839


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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