|
7 | 7 | //===----------------------------------------------------------------------===//
|
8 | 8 | //
|
9 | 9 |
|
| 10 | +// XFAIL: FROZEN-CXX03-HEADERS-FIXME |
| 11 | + |
10 | 12 | // <regex>
|
11 | 13 |
|
12 | 14 | // template <class BidirectionalIterator, class Allocator, class charT, class traits>
|
@@ -669,6 +671,21 @@ int main(int, char**)
|
669 | 671 | assert(m.position(0) == 0);
|
670 | 672 | assert(m.str(0) == s);
|
671 | 673 | }
|
| 674 | + { |
| 675 | + std::cmatch m; |
| 676 | + const char s[] = "$_se"; |
| 677 | + assert(std::regex_match(s, m, std::regex("\\$\\_se"))); |
| 678 | + assert(m.size() == 1); |
| 679 | + assert(!m.prefix().matched); |
| 680 | + assert(m.prefix().first == s); |
| 681 | + assert(m.prefix().second == m[0].first); |
| 682 | + assert(!m.suffix().matched); |
| 683 | + assert(m.suffix().first == m[0].second); |
| 684 | + assert(m.suffix().second == s + std::char_traits<char>::length(s)); |
| 685 | + assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s)); |
| 686 | + assert(m.position(0) == 0); |
| 687 | + assert(m.str(0) == s); |
| 688 | + } |
672 | 689 |
|
673 | 690 | #ifndef TEST_HAS_NO_WIDE_CHARACTERS
|
674 | 691 | {
|
@@ -1305,6 +1322,21 @@ int main(int, char**)
|
1305 | 1322 | assert(m.position(0) == 0);
|
1306 | 1323 | assert(m.str(0) == s);
|
1307 | 1324 | }
|
| 1325 | + { |
| 1326 | + std::wcmatch m; |
| 1327 | + const wchar_t s[] = L"$_se"; |
| 1328 | + assert(std::regex_match(s, m, std::wregex(L"\\$\\_se"))); |
| 1329 | + assert(m.size() == 1); |
| 1330 | + assert(!m.prefix().matched); |
| 1331 | + assert(m.prefix().first == s); |
| 1332 | + assert(m.prefix().second == m[0].first); |
| 1333 | + assert(!m.suffix().matched); |
| 1334 | + assert(m.suffix().first == m[0].second); |
| 1335 | + assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s)); |
| 1336 | + assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s)); |
| 1337 | + assert(m.position(0) == 0); |
| 1338 | + assert(m.str(0) == s); |
| 1339 | + } |
1308 | 1340 | #endif // TEST_HAS_NO_WIDE_CHARACTERS
|
1309 | 1341 |
|
1310 | 1342 | return 0;
|
|
0 commit comments