]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/test/regress/test_anchors.cpp
6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
15 #pragma warning(disable:4127)
21 using namespace boost::regex_constants
;
22 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "ab", match_default
, make_array(0, 2, -2, -2));
23 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "xxabxx", match_default
, make_array(-2, -2));
24 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "xx\nabzz", match_default
, make_array(3, 5, -2, -2));
25 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "ab", match_default
, make_array(0, 2, -2, -2));
26 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "abxx", match_default
, make_array(-2, -2));
27 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "ab\nzz", match_default
, make_array(0, 2, -2, -2));
28 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "\n\n a", match_default
, make_array(-2, -2));
30 TEST_REGEX_SEARCH("^ab", basic
, "ab", match_default
, make_array(0, 2, -2, -2));
31 TEST_REGEX_SEARCH("^ab", basic
, "xxabxx", match_default
, make_array(-2, -2));
32 TEST_REGEX_SEARCH("^ab", basic
, "xx\nabzz", match_default
, make_array(3, 5, -2, -2));
33 TEST_REGEX_SEARCH("ab$", basic
, "ab", match_default
, make_array(0, 2, -2, -2));
34 TEST_REGEX_SEARCH("ab$", basic
, "abxx", match_default
, make_array(-2, -2));
35 TEST_REGEX_SEARCH("ab$", basic
, "ab\nzz", match_default
, make_array(0, 2, -2, -2));
37 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "ab", match_default
| match_not_bol
| match_not_eol
, make_array(-2, -2));
38 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "xxabxx", match_default
| match_not_bol
| match_not_eol
, make_array(-2, -2));
39 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "xx\nabzz", match_default
| match_not_bol
| match_not_eol
, make_array(3, 5, -2, -2));
40 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "ab", match_default
| match_not_bol
| match_not_eol
, make_array(-2, -2));
41 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "abxx", match_default
| match_not_bol
| match_not_eol
, make_array(-2, -2));
42 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "ab\nzz", match_default
| match_not_bol
| match_not_eol
, make_array(0, 2, -2, -2));
44 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "ab", match_default
| match_single_line
, make_array(0, 2, -2, -2));
45 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "xxabxx", match_default
| match_single_line
, make_array(-2, -2));
46 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "xx\nabzz", match_default
| match_single_line
, make_array(-2, -2));
47 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "ab", match_default
| match_single_line
, make_array(0, 2, -2, -2));
48 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "abxx", match_default
| match_single_line
, make_array(-2, -2));
49 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "ab\nzz", match_default
| match_single_line
, make_array(-2, -2));
51 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "ab", match_default
| match_not_bol
| match_not_eol
| match_single_line
, make_array(-2, -2));
52 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "xxabxx", match_default
| match_not_bol
| match_not_eol
| match_single_line
, make_array(-2, -2));
53 TEST_REGEX_SEARCH("^ab", boost::regex::extended
, "xx\nabzz", match_default
| match_not_bol
| match_not_eol
| match_single_line
, make_array(-2, -2));
54 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "ab", match_default
| match_not_bol
| match_not_eol
| match_single_line
, make_array(-2, -2));
55 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "abxx", match_default
| match_not_bol
| match_not_eol
| match_single_line
, make_array(-2, -2));
56 TEST_REGEX_SEARCH("ab$", boost::regex::extended
, "ab\nzz", match_default
| match_not_bol
| match_not_eol
| match_single_line
, make_array(-2, -2));
58 // changes to newline handling with 2.11:
60 TEST_REGEX_SEARCH("^.", boost::regex::extended
, " \n \r\n ", match_default
, make_array(0, 1, -2, 3, 4, -2, 7, 8, -2, -2));
61 TEST_REGEX_SEARCH(".$", boost::regex::extended
, " \n \r\n ", match_default
, make_array(1, 2, -2, 4, 5, -2, 8, 9, -2, -2));
62 #if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
63 TEST_REGEX_SEARCH_W(L
"^.", boost::regex::extended
, L
"\x2028 \x2028", match_default
, make_array(0, 1, -2, 1, 2, -2, -2));
64 TEST_REGEX_SEARCH_W(L
".$", boost::regex::extended
, L
" \x2028 \x2028", match_default
, make_array(0, 1, -2, 2, 3, -2, 3, 4, -2, -2));