OneDrive Client written in D

skilion via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Sep 25 12:37:22 PDT 2015


On Friday, 25 September 2015 at 07:40:18 UTC, Dmitry Olshansky 
wrote:
> Removing anonymous groups and using raw-literal:
>
> regex(`^\s*(\w+)\s*=\s*"(.*)"\s*$`)
>
> Looks simpler I guess.

Good advice, thanks.

> Though if key="value" is expected I'd suggest to use lazy .* - 
> `"(.*?)"` to stop on first " if any.

After playing a bit with it, I realized that it doesn't work in 
this case (a="a"a" still match). The right solution would be 
"(.[^"])"


More information about the Digitalmars-d-announce mailing list