D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7141 - std.regex - escaped characters can form operators in character classes
Summary: std.regex - escaped characters can form operators in character classes
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 04:05 UTC by Nils
Modified: 2012-02-10 06:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nils 2011-12-20 04:05:53 UTC
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 ("||", "&&", "~~").
Comment 2 github-bugzilla 2012-02-05 09:18:19 UTC
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/e859e40a1720c4504e3574566476f00f23130234
Merge pull request #377 from NilsBossung/bugzilla7141

fix bugzilla issue 7141