[mlir][Vector] Fix `vector.shuffle` folder for poison indices (#124863)
[llvm-project.git] / libcxx / test / std / re / re.const / re.matchflag / match_not_bol.pass.cpp
blob6522d429ebccc61ac85de17f7bdbba3a37dae950
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // <regex>
11 // match_not_bol:
12 // The first character in the sequence [first,last) shall be treated as
13 // though it is not at the beginning of a line, so the character ^ in the
14 // regular expression shall not match [first,first).
16 #include <regex>
17 #include <cassert>
18 #include "test_macros.h"
20 int main(int, char**)
23 std::string target = "foo";
24 std::regex re("^foo");
25 assert( std::regex_match(target, re));
26 assert(!std::regex_match(target, re, std::regex_constants::match_not_bol));
30 std::string target = "foo";
31 std::regex re("foo");
32 assert( std::regex_match(target, re));
33 assert( std::regex_match(target, re, std::regex_constants::match_not_bol));
37 std::string target = "fooby";
38 std::regex re("^foo");
39 assert( std::regex_search(target, re));
40 assert(!std::regex_search(target, re, std::regex_constants::match_not_bol));
44 std::string target = "fooby";
45 std::regex re("foo");
46 assert( std::regex_search(target, re));
47 assert( std::regex_search(target, re, std::regex_constants::match_not_bol));
50 return 0;