首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::basic_regex::basic_regex

basic_regex();

(1)

(since C++11)

explicit basic_regex( const CharT* s, flag_type f = std::regex_constants::ECMAScript );

(2)

(since C++11)

basic_regex( const CharT* s, std::size_t count, flag_type f = std::regex_constants::ECMAScript );

(3)

(since C++11)

basic_regex( const basic_regex& other );

(4)

(since C++11)

basic_regex( basic_regex&& other );

(5)

(since C++11)

template< class ST, class SA > explicit basic_regex( const std::basic_string<CharT,ST,SA>& str, flag_type f = std::regex_constants::ECMAScript );

(6)

(since C++11)

template< class ForwardIt > basic_regex( ForwardIt first, ForwardIt last, flag_type f = std::regex_constants::ECMAScript );

(7)

(since C++11)

basic_regex( std::initializer_list<CharT> init, flag_type f = std::regex_constants::ECMAScript );

(8)

(since C++11)

从根据标志解释的字符序列中构造一个新的正则表达式。f...

1%29默认构造函数。构造一个空正则表达式,该表达式将与任何内容不匹配。

2%29从以空结尾的字符串构造正则表达式。s...

3%29从count字符,由s...

4%29复制构造函数。通过复制构造正则表达式other

5%29移动构造函数。的内容构造正则表达式。other使用移动语义。

6%29从字符串构造正则表达式。str...

7%29范围构造函数。使用范围的内容构造字符串。[first, last)...

8%29初始化程序列表构造函数。使用初始化程序列表的内容构造字符串。init...

参数

s

-

pointer to a null-terminated string

count

-

length of a character sequence used to initialize the regex

first, last

-

range of a character sequence used to initialize the regex

str

-

a basic_string used as a source used to initialize the regex

other

-

another regex to use as source to initialize the regex

init

-

initializer list used to initialize the regex

f

-

flags used to guide the interpretation of the character sequence as a regular expression

类型要求

---。

例外

1%29%280%29

2-3%29std::regex_error如果提供的正则表达式无效。

4%29%280%29

5%29

noexcept规格:

noexcept

5-8%29std::regex_error如果提供的正则表达式无效。

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券