26 Sep
2013
26 Sep
'13
6:58 p.m.
On 9/26/2013 12:02 PM, John Maddock wrote: >> I am wondering if it is possible to run directly regular expression >> over a >> list and getting the indexes (begging and end) of the match. For >> example, I >> have a list of strings and a regular expression and I want to know which >> part of the list matches the RE and get the corresponding indexes in the >> list. Any suggestion is welcome. Thank you. ... > 2) Write a composite iterator which enumerates single characters over > the whole collection of strings and pass that to the regex algorithms, > in fact I can't believe we don't have this already in Boost, but it > appears not :-( Perhaps boost::range::join would work something like: std::string s1, s2; auto r12 = boost::join(s1, s2); ...regex...(...begin(r12), end(r12)...) at least for a list of size 2. Jeff