1 // { dg-do run { target c++11 } }
2 // { dg-timeout-factor 3 }
5 // Copyright (C) 2014-2020 Free Software Foundation, Inc.
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING3. If not see
20 // <http://www.gnu.org/licenses/>.
23 #include <testsuite_hooks.h>
24 #include <testsuite_regex.h>
26 using namespace __gnu_test
;
33 std::setlocale(LC_ALL
, "");
35 std::wstring
current_token(L
"II.");
37 std::vector
<std::wregex
> regex_vector
;
39 for (int i
= 0; i
< 4; ++i
)
41 std::regex_constants::syntax_option_type flag
;
42 flag
= std::regex_constants::ECMAScript
| std::regex_constants::icase
;
45 reg
.imbue(std::locale(""));
46 reg
.assign(L
"^(M*(?:CM|DC{1,3}|D|CD|C{1,3}){0,1}(?:XC|LX{1,3}|L|XL|X{1,3}){0,1}(?:IX|VI{0,3}|IV|I{1,3}){0,1}\\.)$", flag
);
48 regex_vector
.emplace_back(reg
);
51 for (auto cit
= regex_vector
.cbegin(); cit
!= regex_vector
.cend(); ++cit
)
53 std::wstring::const_iterator it1
= current_token
.begin();
54 std::wstring::const_iterator it2
= current_token
.end();
55 std::wsmatch current_token_match
;
57 regex_match_debug(it1
, it2
, current_token_match
, *cit
);
58 VERIFY(current_token_match
[0] == current_token
);
59 VERIFY(current_token_match
[1] == current_token
);