Boost logo

Boost :

From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2004-05-13 19:41:37

I was just bitten by an extremely nasty bug, caused in part by my own
foolishness, but also by a subtlety of Boost Regex that probably should be
documented explicitly. gives a list of "The
following Perl like expressions" and says that $N "Expands to the text that
matched sub-expression N."

HOWEVER, Boost Regex is sufficiently general that $10 will match the tenth
subexpression, $25 the twenty fifth, and so forth. Perl is not that general
- it recognizes only $1 through $9 here.

I believed that Boost behaved like Perl. I concatenated "$1" with a random
hexadecimal string, occasionally producing "$10", "$15", etc. before the
letter hexits appeared. This led to many hours of misery.

The documentation should note Boost Regex's generality. The generality is a
good thing - $1 can be separated from later digits with empty () parentheses
- but it needs to be made clear.

Does this also affect the regex standardization proposal? It'd be bad if
some implementers thought they only had to support $1 - $9.

On an unrelated note, the following issues have not yet been addressed:
Lambda Doc Bug,

Boost Array Documentation,

Stephan T. Lavavej

Boost list run by bdawes at, gregod at, cpdaniel at, john at