Re: Issues with std.regex

2013-02-20 Thread MrAppleseed
Hello to everyone, and thank you for your help! Sorry for the delay in response, as I was busy with family matters. However, upon returning today, and with everyone's help, I have successfully gotten it to work. The code below worked out swimmingly: auto reg = regex(`[ 0-9a-zA-Z.*=+-;()"'\[

Re: Issues with std.regex

2013-02-20 Thread MrAppleseed
On Saturday, 16 February 2013 at 21:58:23 UTC, jerro wrote: Pattern with error: `[ 0-9a-zA-Z.*=+-;()"'\[\]<>,{}^#/\]` <--HERE-- `` The problem here is that you have \ right before the ] at the end of the string. Because it is preceeded by \, ] is interpretted as a character you are matching o

Re: Issues with std.regex

2013-02-17 Thread Dmitry Olshansky
17-Feb-2013 01:36, MrAppleseed пишет: On Saturday, 16 February 2013 at 20:33:15 UTC, FG wrote: 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

Re: Issues with std.regex

2013-02-16 Thread FG
On 2013-02-16 22:36, MrAppleseed wrote: Perhaps try this: "[ 0-9a-zA-Z.*=+-;()\"\'\\[\\]<>,{}^#/\\]" I made the changes you suggested above, and although it compiled fine, on the first run I got a similar error: std.regex.RegexException@/usr/include/dmd/phobos/std/regex.d(1942): unexpected en

Re: Issues with std.regex

2013-02-16 Thread jerro
Pattern with error: `[ 0-9a-zA-Z.*=+-;()"'\[\]<>,{}^#/\]` <--HERE-- `` The problem here is that you have \ right before the ] at the end of the string. Because it is preceeded by \, ] is interpretted as a character you are matching on, not as a closing bracket for the initial [. If you want t

Re: Issues with std.regex

2013-02-16 Thread jerro
std.regex.RegexException@/usr/include/dmd/phobos/std/regex.d(1942): wrong CodepointSet Pattern with error: `[ 0-9a-zA-Z.*=+-;()"'[]` <--HERE-- `<>,{}^#/\\]` (Entire error here: http://pastebin.com/Su9XzbXW) You need to put \ in front of [ or ] if you want to match those two characters. The r

Re: Issues with std.regex

2013-02-16 Thread MrAppleseed
On Saturday, 16 February 2013 at 20:33:15 UTC, FG wrote: 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

Re: Issues with std.regex

2013-02-16 Thread MrAppleseed
On Saturday, 16 February 2013 at 20:35:48 UTC, H. S. Teoh wrote: On Sat, Feb 16, 2013 at 09:22:07PM +0100, MrAppleseed wrote: Hey all, I'm currently trying to port my small toy language I invented awhile back in Java to D. However, a main part of my lexical analyzer was regular expression mat

Re: Issues with std.regex

2013-02-16 Thread Namespace
As long as there is \" I get the same error.

Re: Issues with std.regex

2013-02-16 Thread H. S. Teoh
On Sat, Feb 16, 2013 at 09:22:07PM +0100, MrAppleseed wrote: > Hey all, > > I'm currently trying to port my small toy language I invented awhile > back in Java to D. However, a main part of my lexical analyzer was > regular expression matching, which I've been having issues with in > D. The regex

Re: Issues with std.regex

2013-02-16 Thread FG
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

Issues with std.regex

2013-02-16 Thread MrAppleseed
Hey all, I'm currently trying to port my small toy language I invented awhile back in Java to D. However, a main part of my lexical analyzer was regular expression matching, which I've been having issues with in D. The regex expression in question is as follows: [ 0-9a-zA-Z.*=+-;()\"\'\[\]<>