![]() |
Home | Libraries | People | FAQ | More |
boost::xpressive::regex_replace — Build an output sequence given an input sequence, a regex, and a format string or a formatter object, function, or expression.
// In header: <boost/xpressive/regex_algorithms.hpp> template<typename OutIter, typename BidiIter, typename Formatter> ( out, begin, end, basic_regex< re, format, flags = , = ); template<typename OutIter, typename BidiIter> ( out, begin, end, basic_regex< re, format, flags = ); template<typename BidiContainer, typename BidiIter, typename Formatter> ( str, basic_regex< re, format, flags = , = ); template<typename BidiContainer, typename BidiIter, typename Formatter> ( str, basic_regex< re, format, flags = , = ); template<typename Char, typename Formatter> ( str, basic_regex< re, format, flags = , = ); template<typename BidiContainer, typename BidiIter> ( str, basic_regex< re, format, flags = , = ); template<typename BidiContainer, typename BidiIter> ( str, basic_regex< re, format, flags = , = ); template<typename Char> ( str, basic_regex< re, format, flags = );
Constructs a
object: regex_iterator
, and uses regex_iterator
< BidiIter > i(begin, end, re, flags)i
to enumerate through all of the matches m of type
that occur within the sequence match_results
< BidiIter >[begin, end)
. If no such matches are found and !(flags & format_no_copy)
then calls std::copy(begin, end, out)
. Otherwise, for each match found, if !(flags & format_no_copy)
calls std::copy(m.prefix().first, m.prefix().second, out)
, and then calls m.format(out, format, flags)
. Finally if !(flags & format_no_copy)
calls std::copy(last_m.suffix().first, last_m.suffix().second, out)
where last_m
is a copy of the last match found.
If flags & format_first_only
is non-zero then only the first match found is replaced.
Parameters: |
|
||||||||||||
Requires: |
Type |
||||||||||||
Requires: |
Type |
||||||||||||
Requires: |
Type |
||||||||||||
Requires: |
|
||||||||||||
Returns: |
The value of the output iterator after the output sequence has been written to it. |
||||||||||||
Throws: |
regex_error on stack exhaustion or invalid format string. |