1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 // template <class charT, class traits = regex_traits<charT>> class basic_regex;
13 // basic_regex(const charT* p, size_t len);
18 #include "test_macros.h"
20 template <class CharT
>
22 test(const CharT
* p
, std::size_t len
, unsigned mc
)
24 std::basic_regex
<CharT
> r(p
, len
);
25 assert(r
.flags() == std::regex_constants::ECMAScript
);
26 assert(r
.mark_count() == mc
);
31 test("\\(a\\)", 5, 0);
32 test("\\(a[bc]\\)", 9, 0);
33 test("\\(a\\([bc]\\)\\)", 13, 0);
34 test("(a([bc]))", 9, 2);
36 test("(\0)(b)(c)(d)", 12, 4);
37 test("(\0)(b)(c)(d)", 9, 3);
38 test("(\0)(b)(c)(d)", 3, 1);
39 test("(\0)(b)(c)(d)", 0, 0);