Boost logo

Boost Users :

From: Michael Coles, MCDBA (admin_at_[hidden])
Date: 2006-04-09 12:15:35


<snip>
>> Regex ==> "(\d+)"
>> Search String ==> "Give me 100 dollars or give me 2001 dollars."
>>
>> Is there a way to determine that the subexpression matched at
>> positions 8 and 31 in the search string, and that the lengths of the
>> matches were three and four characters?
</snip>

>Take a look at the position(sub) and length(sub) member functions of
>match_results<>
>
>sub_match also has a length() member function, but no position() because it
>doesn't know where the search started from (unlike match_results which
>does).
>
>There's no need to get involved with repeated captures and match_extra etc
>BTW.
>
>John.

Thank you, I think that's exactly what I need. Appreciate it!


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net