regex: flag for "global" search?
I'm trying to capture the sub-expressions in a fqdn (e.g., one.two.three.com.). One piece of Perl-speak for the expression is: "/ (\w+)\./g". I've been using boost_search and trying variations on "(?: (\\w+)\\.)+" but I can't seem to get all the sub-expressions into the match_results. There's got to be a flag I've been overlooking. Any suggestion will be appreciated. TIA
Use boost::regex_grep. The boost::regex_search only finds the first match.
I'm trying to capture the sub-expressions in a fqdn (e.g., one.two.three.com.). One piece of Perl-speak for the expression is: "/ (\w+)\./g". I've been using boost_search and trying variations on "(?: (\\w+)\\.)+" but I can't seem to get all the sub-expressions into the match_results.
There's got to be a flag I've been overlooking. Any suggestion will be appreciated.
I'm trying to capture the sub-expressions in a fqdn (e.g., one.two.three.com.). One piece of Perl-speak for the expression is: "/ (\w+)\./g". I've been using boost_search and trying variations on "(?: (\\w+)\\.)+" but I can't seem to get all the sub-expressions into the match_results.
There's got to be a flag I've been overlooking. Any suggestion will be appreciated.
No it doesn't work like that - if you want to find all occurrences of an expression then you need to either: * Repeatedly call regex_search or * Use regex_grep instead. John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
participants (3)
-
dick.bridges@tais.com
-
Edward Diener
-
John Maddock