Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2005-09-19 11:55:34


Rob Stewart wrote:
> From: "John Maddock" <john_at_[hidden]>
>
>>>Not sure what to do about "\\<" and "\\>", though.
>>
>>Sigh, yes it's a legacy from BSD style expressions, and probably shouldn't
>>be enabled for Perl style expressions, they're just so useful though, and
>>more efficient and precise than \b.
>
>
> They are most definitely handy. I used them regularly with grep
> and vi (usually viper mode in emacs, but still). xpressive could
> include them as an extension, right?
>

Static xpressive already has them. They're spelled "bow" and "eow". The
question is whether they should be recognized by dynamic xpressive by
default. If we follow the ECMAScript standard to the letter, "\\<"
should match a literal '<' character. So giving it a different behavior
would be a non-conforming extension.

If we want to make \\< and \\> begin- and end-word-assertions, we'd need
to change the regex proposal. It's too late for TR1, but maybe for
C++0x. In the mean time, I've changed xpressive to recognize \\< and \\<
(in boost-sandbox CVS now). That makes xpressive non-conforming, but
that is arguably more useful and less surprising than the standard behavior.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk