Marshall Clow | e0f8672 | 2014-02-19 21:21:11 +0000 | [diff] [blame] | 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 | // regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, |
| 15 | // const regex_type&& re, int submatch = 0, |
| 16 | // regex_constants::match_flag_type m = |
| 17 | // regex_constants::match_default); |
| 18 | |
Dan Albert | 1d4a1ed | 2016-05-25 22:36:09 -0700 | [diff] [blame^] | 19 | #if __cplusplus <= 201402L |
| 20 | #error |
| 21 | #else |
| 22 | |
Marshall Clow | e0f8672 | 2014-02-19 21:21:11 +0000 | [diff] [blame] | 23 | #include <regex> |
| 24 | #include <cassert> |
Marshall Clow | 85d5622 | 2016-04-26 19:29:35 +0000 | [diff] [blame] | 25 | |
Marshall Clow | e0f8672 | 2014-02-19 21:21:11 +0000 | [diff] [blame] | 26 | int main() |
| 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(phone_book), std::end(phone_book)-1, |
| 32 | std::regex("\\d{3}-\\d{4}"), -1); |
| 33 | } |
| 34 | } |
Dan Albert | 1d4a1ed | 2016-05-25 22:36:09 -0700 | [diff] [blame^] | 35 | #endif |