Bug 14529 – Bug in Regex case insensitive match

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-04-30T04:41:00Z
Last change time
2015-07-07T22:23:46Z
Assigned to
nobody
Creator
kasamia.o.kasatua

Comments

Comment #0 by kasamia.o.kasatua — 2015-04-30T04:41:51Z
The following code describes the problem: import std.stdio; import std.regex; void main() { auto ctr = ctRegex!(r"^[CF]$", "i"); foreach(line; stdin.byLine) { foreach(m; line.matchAll(ctr)) { writeln("match: ", m.hit); } } } -- the simple regex should match: C, c, F, f but only C, c, F will match. and if you switch the order inside the char class: [FC] only F, f, C are matched, but not c It seems like there's something wrong with the last char that should match. The same problem happens when using regex obj too.
Comment #1 by dsp — 2015-07-06T14:22:15Z
I can reproduce this on 2.068-dev
Comment #2 by dsp — 2015-07-06T15:09:09Z