template <class charT, class traits = regex_traits<charT> > class basic_regex;
|
|
成員型別 | 定義 | 說明 |
---|---|---|
value_type | 第一個模板引數 (charT) | 字元型別。 |
traits_type | 第二個模板引數 (特性 (traits))<char> | Regex traits(預設為regex_traits)。 |
string_type | traits::string_type | 字串型別(對於regex 是string,對於wregex 是wstring)。 |
flag_type | regex_constants::syntax_option_type | |
locale_type | traits::locale_type | 對於標準regex_traits的locale。 |
flag* | 對語法的影響 | 備註 |
---|---|---|
icase | 不區分大小寫 | 正則表示式匹配時忽略大小寫。 |
nosubs | 無子表示式 | 要放回的字元的match_results結構將不包含子表示式匹配。 |
optimize | 最佳化匹配 | 優先匹配效率,而不是構造 regex 物件的效率。 |
collate | 語言環境敏感性 | 字元範圍,例如"[a-b]"受語言環境影響。 |
ECMAScript | ECMAScript 語法 | 正則表示式遵循以下六種語法之一。 位掩碼需要設定這六種語法標誌中的一個(且僅一個)才能具有有效值。 |
basic | 基本 POSIX 語法 | |
extended | 擴充套件 POSIX 語法 | |
awk | Awk POSIX 語法 | |
grep | Grep POSIX 語法 | |
egrep | Egrep POSIX 語法 |