다음을 통해 공유


regex_iterator 클래스

Iterator class for matches.

template<class BidIt, class Elem = iterator_traits<BidIt>::value_type,
    class RXtraits = regex_traits<Elem> >
        class regex_iterator {
public:
    typedef basic_regex<Elem, RXtraits> regex_type;
    typedef match_results<BidIt> value_type;
    typedef std::forward_iterator_tag iterator_category;
    typedef std::ptrdiff_t difference_type;
    typedef const match_results<BidIt>* pointer;
    typedef const match_results<BidIt>& reference;

    regex_iterator();
    regex_iterator(BidIt first, BidIt last,
        const regex_type& re,
        regex_constants::match_flag_type f = regex_constants::match_default);

    bool operator==(const regex_iterator& right);
    bool operator!=(const regex_iterator& right);
    const match_results<BidIt>& operator*();
    const match_results<BidIt> *operator->();
    regex_iterator& operator++();
    regex_iterator& operator++(int);

    BidIt begin;                            // exposition only
    BidIt end;                              // exposition only
    regex_type *pregex;                     // exposition only
    regex_constants::match_flag_type flags; // exposition only
    match_results<BidIt> match;             // exposition only
    };

매개 변수

  • BidIt
    The iterator type for submatches.

  • Elem
    The type of elements to match.

  • RXtraits
    Traits class for elements.

설명

The template class describes a constant forward iterator object. It extracts objects of type match_results<BidIt> by repeatedly applying its regular expression object *pregex to the character sequence defined by the iterator range [begin, end).

예제

See the following topics for examples on regular expressions:

요구 사항

헤더:<regex>

네임스페이스: std

참고 항목

참조

<regex>

regex_iterator 클래스

기타 리소스

<regex> 멤버