match_results Class
會保留一連串的元素。
template<class BidIt,
class Alloc = allocator<typename iterator_traits<BidIt>::value_type> >
class match_results {
public:
explicit match_results(const Alloc& alloc = Alloc());
match_results(const match_results& right);
match_results& operator=(const match_results& right);
difference_type position(size_type sub = 0) const;
difference_type length(size_type sub = 0) const;
string_type str(size_type sub = 0) const;
const_reference operator[](size_type n) const;
const_reference prefix() const;
const_reference suffix() const;
const_iterator begin() const;
const_iterator end() const;
template<class OutIt>
OutIt format(OutIt out,
const string_type& fmt, match_flag_type flags = format_default) const;
string_type format(const string_type& fmt,
match_flag_type flags = format_default) const;
allocator_type get_allocator() const;
void swap(const match_results& other) throw();
size_type size() const;
size_type max_size() const;
bool empty() const;
typedef sub_match<BidIt> value_type;
typedef const typename Alloc::const_reference const_reference;
typedef const_reference reference;
typedef T0 const_iterator;
typedef const_iterator iterator;
typedef typename iterator_traits<BidIt>::difference_type difference_type;
typedef typename Alloc::size_type size_type;
typedef Alloc allocator_type;
typedef typename iterator_traits<BidIt>::value_type char_type;
typedef basic_string<char_type> string_type;
};
參數
BidIt
元素 iterator 型別。Alloc
管理存放裝置配置器類型。
備註
樣板類別描述物件來控制型別的項目不可以修改一連串sub_match<BidIt>規則運算式搜尋所產生的。 每個項目會指向比對擷取的群組對應至該項目的序列。
需求
標頭: <regex>
Namespace: 標準