| Home | Libraries | People | FAQ | More

## Function template find_all_regex

boost::algorithm::find_all_regex — Find all regex algorithm.

## Synopsis

    template<typename SequenceSequenceT, typename CollectionT, typename CharT,
             typename RegexTraitsT, typename RegexAllocatorT>
      SequenceSequenceT &
      find_all_regex(SequenceSequenceT & Result, const CollectionT & Input,
                     const reg_expression< CharT, RegexTraitsT, RegexAllocatorT > & Rx,
                     match_flag_type Flags = match_default);

## Description

This algorithm finds all substrings matching the give regex in the input.

Each part is copied and added as a new element to the output container. Thus the result container must be able to hold copies of the matches (in a compatible structure like std::string) or a reference to it (e.g. using the iterator range class). Examples of such a container are `std::vector<std::string>` or `std::list<boost::iterator_range<std::string::iterator>>`

Parameters

Flags

  Regex options

Input

  A container which will be searched.

Result

  A container that can hold copies of references to the substrings.

Rx

  A regular expression

Returns: A reference to the result
Notes: Prior content of the result will be overwritten.

This function provides the strong exception-safety guarantee

| Copyright © 2002-2004 Pavol Droba