← Back to index
|
Original Bugzilla link
Bug 13306 – ctRegex compilation fails if an alternative pattern is specified inside a group
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-08-16T11:04:00Z
Last change time
2014-08-18T05:12:42Z
Assigned to
nobody
Creator
maxpat78
Comments
Comment #0
by maxpat78 — 2014-08-16T11:04:13Z
This little sample code can't get compiled if the ctRegex! version is used (DMD 2.065): =====*=====*=====*=====*=====*=====*=====*=====* import std.stdio; import std.regex; void main() { auto s0 = `url:"
http://download.microsoft.com/download/Windows8.1-KB000000.msu
"`; auto s1 = `url:"
http://download.microsoft.com/download/Windows8.1-KB000000.exe
"`; //~ C:\Bin\DMD2\windows\bin\..\..\src\phobos\std\regex.d-mixin-5885(6214): Error: found 'else' instead of statement //~ auto rx = ctRegex!(`url:"(
http://download.microsoft.com/download.+?(msu|exe))
"`); // This works fine as expected, instead... auto rx = regex(`url:"(
http://download.microsoft.com/download.+?(msu|exe))
"`); writeln(match(s0, rx).empty()); writeln(match(s1, rx).empty()); } =====*=====*=====*=====*=====*=====*=====*=====*
Comment #1
by dmitry.olsh — 2014-08-17T16:53:52Z
Works in git master and 2.066-rc2. You can get 2.066-RC2 here:
http://wiki.dlang.org/DMD_v2.066.0-rc2
Comment #2
by maxpat78 — 2014-08-18T05:12:42Z
Ok, thanks!