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);
}

Reply via email to