[regex] nested negated character classes

The following trivial pattern: boost::regex pat("[\\D]"); throws an "Invalid or trailing backslash" exception. This is in violation of the ECMAScript (ECMA-262) specification, section 15.10.1, which means Boost.Regex does not satisfy TR1. Known problem? Any intention to fix this? -- Eric Niebler Boost Consulting www.boost-consulting.com

The following trivial pattern:
boost::regex pat("[\\D]");
throws an "Invalid or trailing backslash" exception. This is in violation of the ECMAScript (ECMA-262) specification, section 15.10.1, which means Boost.Regex does not satisfy TR1. Known problem? Any intention to fix this?
Yes, known problem, don't know how to fix it easily either (for ECMA script that doesn't handle locales or character classes that match anything outside the ACSII range this is of course trivial, much harder if you do handle those things though). You're the first to complain about it as well BTW. John.

John Maddock wrote:
The following trivial pattern:
boost::regex pat("[\\D]");
throws an "Invalid or trailing backslash" exception.
Yes, known problem, don't know how to fix it easily either
I peeked at your code. For narrow characters, you can easily merge the negated character class into the re_set.map_[256]. For wide characters, you'll need to store a list of negated character classes to re_set_long, just as you currently store a list of chars, ranges and equivalences. -- Eric Niebler Boost Consulting www.boost-consulting.com

I peeked at your code. For narrow characters, you can easily merge the negated character class into the re_set.map_[256]. For wide characters, you'll need to store a list of negated character classes to re_set_long, just as you currently store a list of chars, ranges and equivalences.
Yes you're right, I realised that just after I posted, Shuffles off embarrassed into the sunset... John.
participants (2)
-
Eric Niebler
-
John Maddock