Regexp help (possible bug?)

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat May 26 09:58:41 PDT 2007


"gareis" <dhasenan at gmail.com> wrote in message 
news:f399o6$n1f$1 at digitalmars.com...
> Argh -- forget that. I forget that regexps require an extra level of 
> escaping;
> that should have been:
> ---
> std.regexp.find(foo, "[^\\\\]#");

If you use WYSIWYG strings, you can avoig the ugly double escaping:

std.regexp.find(foo, r"[^\\]#");

or

std.regexp.find(foo, `[^\\]#`);

I've also never heard of a pound sign being called an "octalthorpe"? 




More information about the Digitalmars-d-learn mailing list