Boost C++ 库

...世界上最受推崇、设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ Coding Standards

函数模板 replace_regex_copy - Boost C++ 函数库
PrevUpHomeNext

函数模板 replace_regex_copy

boost::replace_regex_copy — 替换正则表达式算法。

提要

// In header: <boost/algorithm/string/regex.hpp>


template<typename OutputIteratorT, typename RangeT, typename CharT, 
         typename RegexTraitsT, typename FormatStringTraitsT, 
         typename FormatStringAllocatorT> 
  OutputIteratorT 
  replace_regex_copy(OutputIteratorT Output, const RangeT & Input, 
                     const basic_regex< CharT, RegexTraitsT > & Rx, 
                     const std::basic_string< CharT, FormatStringTraitsT, FormatStringAllocatorT > & Format, 
                     match_flag_type Flags = match_default|format_default);

描述

搜索与给定正则表达式匹配的子字符串,并使用指定的格式对其进行格式化。
结果是输入的修改副本。它作为序列返回,或复制到输出迭代器。

[Note] 注意

此函数的第二个变体提供强异常安全保证。

参数

输出:

一个输出迭代器,结果将被复制到该迭代器。

输入

一个输入字符串

Rx

正则表达式

Format

正则表达式格式定义

标志

正则表达式选项

返回

一个输出迭代器,指向最后一个插入字符之后的位置,或输入的修改副本。


PrevUpHomeNext