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 //===----------------------------------------------------------------------===//
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).
18 #include "test_macros.h"
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";
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";
46 assert( std::regex_search(target
, re
));
47 assert( std::regex_search(target
, re
, std::regex_constants::match_not_bol
));