Issues with std.regex

FG home at fgda.pl
Sat Feb 16 12:33:04 PST 2013


On 2013-02-16 21:22, MrAppleseed wrote:
> auto reg = regex("[ 0-9a-zA-Z.*=+-;()\"\'\[\]<>,{}^#/\\]");
>
> When I try to run the code above, I get:
> parser.d(64): Error: undefined escape sequence \[
> parser.d(64): Error: undefined escape sequence \]
>
> When I remove the escaped characters (turning my regex into
> "[ 0-9a-zA-Z.*=+-;()\"\'[]<>,{}^#/\\]"), I get no issues compiling or linking.
> However, on first run, I get the following error (I cut the error short, full
> error is pasted http://pastebin.com/vjMhkx4N):
>
> std.regex.RegexException@/usr/include/dmd/phobos/std/regex.d(1942): wrong
> CodepointSet
> Pattern with error: `[ 0-9a-zA-Z.*=+-;()"'[]` <--HERE-- `<>,{}^#/\]`
>

Perhaps try this:  "[ 0-9a-zA-Z.*=+-;()\"\'\\[\\]<>,{}^#/\\]"



More information about the Digitalmars-d-learn mailing list