[Issue 7551] Regex parsing bug for right bracket in character class

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 24 11:28:27 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7551


Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh at gmail.com


--- Comment #1 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2012-02-24 11:28:25 PST ---
It perfectly fine to use escapes for special characters:

import std.regex;
void main() {
    auto r = regex("[\]]");
}

The reason for killing first bracket doesn't count rule (if ever knew it
existed)
is that new regex allows doing things like 
[[abc0-9]--[bcd||1-9]] 
i.e. set operations 
the above should get you [bc0], it's more useful with \p{xxx} things.
Basically braces do matter more now. 
But this many other languages... (or better libraries) - which ones? Unless
there is strong precident I'm not doing another special case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list