Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2007-04-27 12:32:48


Lorenzo Bettini wrote:
> Eric Niebler wrote:
>> John Maddock wrote:
>>> Lorenzo Bettini wrote:
>>>> Hi
>>>>
>>>> is there any plan to support more than 9 back references in the regex
>>>> library?
>>> You can have as many marked sub-expressions as you want, and refer to them
>>> in the match_results structure once you have a match. What you can't do at
>>> present is have a true back-reference say \12 in your expression.
>>
>> You could use xpressive, which handles this case.
>
> OK, thanks, I'll take a look at it... is xpressive compatible with
> boost::regex expressions?

Boost.Regex and Boost.Xpressive accept the same basic regex syntax.
Xpressive doesn't yet support collating elements (eg., [.ae.]) and
equivalence classes (eg., [=a=]).

I should also say that as a result of your inquiry, I found an
off-by-one error in Xpressive's handling of back-references over 9. If
you want to access back-ref \12, you'll need 13 captures in your
expression. Darn. It might be too late to fix for 1.34, but I'll patch
the archive in the Vault. It's already fixed in HEAD.

-- 
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