blob: fcaee8c3d68629285ec12fdd43b377e5f0dfbb51 [file] [log] [blame]
Howard Hinnant5cd66582010-08-13 18:11:23 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant5cd66582010-08-13 18:11:23 +00007//
8//===----------------------------------------------------------------------===//
9
Eric Fiselier9f7cc582017-04-18 23:42:15 +000010// UNSUPPORTED: c++98, c++03
11
Howard Hinnant5cd66582010-08-13 18:11:23 +000012// <regex>
13
14// template <class charT, class traits = regex_traits<charT>> class basic_regex;
15
16// basic_regex&
17// assign(initializer_list<charT> il,
18// flag_type f = regex_constants::ECMAScript);
19
20#include <regex>
21#include <cassert>
Marshall Clowfd5ceb22016-04-26 16:24:44 +000022#include "test_macros.h"
Howard Hinnant5cd66582010-08-13 18:11:23 +000023
24int main()
25{
Howard Hinnant5cd66582010-08-13 18:11:23 +000026 std::regex r2;
27 r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'});
28 assert(r2.flags() == std::regex::ECMAScript);
29 assert(r2.mark_count() == 2);
30
31 r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended);
32 assert(r2.flags() == std::regex::extended);
33 assert(r2.mark_count() == 2);
Howard Hinnant5cd66582010-08-13 18:11:23 +000034}