Bug 7141 – std.regex - escaped characters can form operators in character classes
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-12-20T04:05:00Z
Last change time
2012-02-10T06:51:51Z
Assigned to
nobody
Creator
nilsbossung
Comments
Comment #0 by nilsbossung — 2011-12-20T04:05:53Z
I think the pattern should be interpreted as CharacterClass('a', Range('-', 'b')), but currently it is interpreted as CharacterClass(Difference('a', 'b')):
---
string pattern = `[a\--b]`;
assert(match("-", pattern));
assert(match("b", pattern));
---
This also applies to the other set operators ("||", "&&", "~~").