D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7440 - ctRegex does not work when using alternatives ('|') involving a '+' inside non-capturing group ('(?:…)')
Summary: ctRegex does not work when using alternatives ('|') involving a '+' inside no...
Status: RESOLVED DUPLICATE of issue 9634
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2012-02-05 01:51 UTC by kennytm
Modified: 2013-05-12 14:03 UTC (History)
1 user (show)

See Also:


Attachments
Stripped down regex parser #2 (13.01 KB, text/plain)
2012-04-17 02:08 UTC, Dmitry Olshansky
Details

Note You need to log in before you can comment on or make changes to this issue.
Description kennytm 2012-02-05 01:51:58 UTC
Test case:

------------------------------------------------------------------------------
import std.regex;

// using capturing group has no problem.
enum bug7440a_1_workaround = ctRegex!`(b*|d+)`;
enum bug7440a_2_workaround = ctRegex!`(a|b+)`;
enum bug7440a_3_workaround = ctRegex!`(a|[^a]+)`;

// using '|' inside a '(?:...)' may cause InfiniteEnd or some other error.
enum bug7440a_1 = ctRegex!`(?:b*|d+)`;
enum bug7440a_2 = ctRegex!`(?:a|b+)`;
enum bug7440a_3 = ctRegex!`(?:a|[^a]+)`;
------------------------------------------------------------------------------
Comment 1 Dmitry Olshansky 2012-04-17 02:08:05 UTC
Created attachment 1095 [details]
Stripped down regex parser #2
Comment 2 Dmitry Olshansky 2012-04-17 02:11:15 UTC
Not a Phobos bug. It's in CTFE side of things. Nowadays it triggers assert.
Judging by the assert firing off it's a likely duplicate of Issue 7810.
Issue 7810 also features smaller test case.
Comment 3 Dmitry Olshansky 2012-11-30 12:33:39 UTC
(In reply to comment #2)
> Not a Phobos bug. It's in CTFE side of things. Nowadays it triggers assert.
> Judging by the assert firing off it's a likely duplicate of Issue 7810.
> Issue 7810 also features smaller test case.

Now 7810 is fixed and I see that this bug is a different beast, will look into reducing it more.
Comment 4 Dmitry Olshansky 2013-03-12 04:35:47 UTC
Comment on attachment 1095 [details]
Stripped down regex parser #2

Now this snippet works, there is another bug.
Comment 5 Dmitry Olshansky 2013-05-12 14:03:13 UTC
Has more tests but with the same root cause as 9634.

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