
hallouina-ml@yahoo.fr wrote:
I need Perl style capture like m/(some_regex)/g
because I need the g flag (to capture more than one time my regex). So if I understand the documentation (as you can see, my english is far from beeing perfect...) ; if I want to use the g flag equivalent in my regex, I need to enable this feature.
Oh no you don't :-) The Perl /g flag is something different again: the equivalent functionality in Boost.Regex is regex_iterator, which enumerates one at a time over all the possible matches in a string. Repeated captures come into play when you have say an expression "(something)+" matched against "somethingsomething" in which case in Perl: $0 = "somethingsomething" $1 = "something" With BOOST_REGEX_MATCH_EXTRA enabled then $1 contains a list of all the "something"'s matched by the first capturing group within a single overall match. I hope this is clear, Regards, John Maddock.