Home | History | Annotate | Download | only in re.tokiter.cnstr
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <regex>
     11 
     12 // class regex_iterator<BidirectionalIterator, charT, traits>
     13 
     14 // template <size_t N>
     15 // regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
     16 //                      const regex_type&& re,
     17 //                      const int (&submatches)[N],
     18 //                      regex_constants::match_flag_type m =
     19 //                                              regex_constants::match_default);
     20 
     21 #include <__config>
     22 
     23 #if _LIBCPP_STD_VER <= 11
     24 #error
     25 #else
     26 
     27 #include <regex>
     28 #include <vector>
     29 #include <cassert>
     30 
     31 int main()
     32 {
     33     {
     34         std::regex phone_numbers("\\d{3}-(\\d{4})");
     35         const char phone_book[] = "start 555-1234, 555-2345, 555-3456 end";
     36         const int indices[] = {-1, 0, 1};
     37         std::cregex_token_iterator i(std::begin(phone_book), std::end(phone_book)-1,
     38                                      std::regex("\\d{3}-\\d{4}"), indices);
     39     }
     40 }
     41 #endif
     42