| 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | // <regex> |
| 10 | |
| 11 | // class regex_iterator<BidirectionalIterator, charT, traits> |
| 12 | |
| 13 | // regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, |
| 14 | // const regex_type&& re, int submatch = 0, |
| 15 | // regex_constants::match_flag_type m = |
| 16 | // regex_constants::match_default); |
| 17 | |
| 18 | #include <regex> |
| 19 | #include <cassert> |
| 20 | #include "test_macros.h" |
| 21 | |
| 22 | #if TEST_STD_VER < 14 |
| 23 | #error |
| 24 | #endif |
| 25 | |
| 26 | int main(int, char**) |
| 27 | { |
| 28 | { |
| 29 | std::regex phone_numbers("\\d{3}-\\d{4}" ); |
| 30 | const char phone_book[] = "start 555-1234, 555-2345, 555-3456 end" ; |
| 31 | std::cregex_token_iterator i(std::begin(arr: phone_book), std::end(arr: phone_book)-1, |
| 32 | std::regex("\\d{3}-\\d{4}" ), -1); |
| 33 | } |
| 34 | |
| 35 | return 0; |
| 36 | } |
| 37 | |