std.regex bug? My regex doesn't match what it's supposed to.

Stanislav Blinov blinov at loniir.ru
Thu Feb 3 07:21:07 PST 2011


03.02.2011 18:03, Alex Folland пишет:
> I figured out the bug. Inside a set of square brackets, \s doesn't 
> match whitespace. It matches s instead. I'm uncertain exactly how the 
> ECMA-262 part 15.10 regular expression specification is meant to 
> handle that situation.
It does match for me:

foreach(m; match("a b c d e", regex("[a-z][\\s]?")))
{
writefln("%s[%s]%s", m.pre, m.hit, m.post);
}


More information about the Digitalmars-d-learn mailing list