std::match_results
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <regex>
|
||
| template< class BidirIt, |
(C++11 起) | |
類模板std::match_results由一組字元序列,表示正則表達式匹配的結果.
Original:
The class template std::match_results holds a collection of character sequences that represent the result of a regular expression match.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
這是一種專門分配器感知容器。它只能被默認創建或修改傳遞給std::regex_search()或std::regex_match()演算法.
Original:
This is a specialized allocator-aware container. It can only be default created or modified by passing to the std::regex_search() or std::regex_match() algorithms.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
的sub_match(索引0)在match_result始終代表完全匹配一個正則表達式內的靶序列,並隨後的sub_matches代表子表達式匹配相應的序列左括弧分隔的子表達式在正則表達式.
Original:
The first sub_match (index 0) contained in a match_result always represents the full match within a target sequence made by a regex, and subsequent sub_matches represent sub-expression matches corresponding in sequence to the left parenthesis delimiting the sub-expression in the regex.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 類型要求
-BidirIt must meet the requirements of BidirectionalIterator.
| ||
-Alloc must meet the requirements of Allocator.
|
[编辑] 專業化
常見的字元序列類型的幾個專業,分別為:
Original:
Several specializations for common character sequence types are provided:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| Defined in header
<regex> | |
| 類型
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
cmatch
|
match_results<const char*> |
wcmatch
|
match_results<const wchar_t*> |
smatch
|
match_results<std::string::const_iterator> |
wsmatch
|
match_results<std::wstring::const_iterator> |
[编辑] 會員類型
| 會員類型
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
allocator_type
|
Allocator |
value_type
|
std::sub_match<BidirIt> |
const_reference
|
const value_type& |
reference
|
const_reference |
const_iterator
|
「實現定義的'(取決於基礎容器)
Original: implementation defined (depends on the underlying container) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
iterator
|
const_iterator |
difference_type
|
std::iterator_traits<BidirIt>::difference_type |
size_type
|
std::allocator_traits<Alloc>::size_type |
char_type
|
std::iterator_traits<BidirIt>::value_type |
string_type
|
std::basic_string<char_type> |
[编辑] 成員函數
| 構造對象 Original: constructs the object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 解構的對象 Original: destructs the object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 分配的內容 Original: assigns the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 返回的關聯分配器 Original: returns the associated allocator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
Original: State The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (公共成員函數) | |
Original: Size The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 檢查是否匹配成功 Original: checks whether the match was successful The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 返回匹配的數目,在一個完全的結果狀態 Original: returns the number of matches in a fully-established result state The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 返回的最大可能數目的子匹配 Original: returns the maximum possible number of sub-matches The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
Original: Element access The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 返回的特定子匹配的長度 Original: returns the length of the particular sub-match The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 返回的特定子匹配的第一個字元的位置 Original: returns the position of the first character of the particular sub-match The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 返回的字元序列為特定子如同 Original: returns the sequence of characters for the particular sub-match The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 返回指定的子匹配 Original: returns specified sub-match The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 返回子序列之間的靶序列的開頭和全匹配的開始. Original: returns sub-sequence between the beginning of the target sequence and the beginning of the full match. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 返回子序列結束之間的完全匹配和靶序列的結束 Original: returns sub-sequence between the end of the full match and the end of the target sequence The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
Original: Iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 迭代器返回的列表的開頭的子匹配 Original: returns iterator to the beginning of the list of sub-matches The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
| 迭代器返回的列表的末尾的子匹配 Original: returns iterator to the end of the list of sub-matches The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
Original: Format The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| formats match results for output (公共成員函數) | |
Original: Modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 交換的內容 Original: swaps the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成員函數) | |
[编辑] 非成員函數
| 字典的值進行比較,在這兩個比賽的結果 Original: lexicographically compares the values in the two match result The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函數模板) | |
| 專業的 std::swap()演算法Original: specializes the std::swap() algorithmThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函數模板) | |