
The xpressive docs say sregex rex = sregex::compile( "(\\w+) (\\w+)!" ); can be expressed as sregex rex = (s1= +_w) >> ' ' >> (s2= +_w) >> '!'; . Shouldn't this be sregex rex = +_w >> ' ' >> +_w >> '!'; since you don't need to refer to previous matches? Thanks -Thorsten -- Thorsten Ottosen ---------------------------- www.dezide.com http://www.cs.aau.dk/index2.php?content=Research/mi www.boost.org www.open-std.org/JTC1/SC22/WG21/

Thorsten Ottosen wrote:
The point the doc is making is that the two expressions are equivalent. Without the captures, the second regex doesn't do exactly what the first one does. For instance, when written the first way, the resulting match_results will have saved sub_matches 1 and 2, whereas the second one will not. HTH -- Eric Niebler Boost Consulting www.boost-consulting.com
participants (2)
-
Eric Niebler
-
Thorsten Ottosen