www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7567] New: Lazy quantifiers fail with ctRegex

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7567

           Summary: Lazy quantifiers fail with ctRegex
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: beatgammit gmail.com



Overview:

ctRegex fails to compile some regular expressions that regex does.



Steps to reproduce:

The following regular expressions fail with ctRegex, put work with regex
compiled at runtime:

(a+?)?b
(a*?)?b
(a{0,}?)?b
(a{1,}?)?b



Actual Results:

I get the following error:

/usr/include/d/dmd/phobos/std/regex.d(6486): found 'else' instead of statement



Expected results:

I expected ctRegex to behave the same as regex, and compile the same set of
regular expressions.



Build:

DMD v2.058



Additional information:

The following regular expressions work with both:

(a{1,5}?)?b
a*?b
(a*?)b

It seems to be a problem with having a lazy quantifier followed by the ?.

I am building a regex to parse URIs:


   <fragment>.*))?$

This works fine with the regex function, but breaks when I use ctRegex.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 23 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7567


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dmitry.olsh gmail.com
         Resolution|                            |DUPLICATE



09:36:11 PDT ---
And right after this message I get the well known thingie: 

Error: assert(this.ir[orStart].code() == cast(IR)129u) failed
C:\dmd2\src\phobos\std\regex.d    1150    

So it's a duplicate of bug 7810 but the end result is more obscure.

*** This issue has been marked as a duplicate of issue 7810 ***

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