Boost logo

Boost Users :

Subject: Re: [Boost-users] Running Regular expression (RE) over a list, array or map
From: Olivier Austina (olivier.austina_at_[hidden])
Date: 2013-09-26 13:15:17


Thanks John, I will try both options.

Regards
Olivier

2013/9/26 John Maddock <john_at_[hidden]>

> 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.
>>
>
> You have two options:
>
> 1) Use the partial match option to search each item in the collection in
> turn, and then "do something" if regex indicates that there may be a match
> that spans two items in the collection.
> 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 :-(
>
> HTH, John.
> ______________________________**_________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/**mailman/listinfo.cgi/boost-**users>
>



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