Lines Matching refs:RE
47 using pcrecpp::RE;
71 RE pattern("ruby:\\d+"); in Timing1()
80 RE pattern("ruby:(\\d+)"); in Timing2()
94 RE line_matcher(".*\n"); in Timing3()
116 RE newre(buf);
133 CHECK(RE("([0-9a-fA-F]+)[uUlL]*").FullMatch(#value, Hex(&v))); \ in RadixTests()
135 CHECK(RE("([0-9a-fA-FxX]+)[uUlL]*").FullMatch("0x" #value, CRadix(&v))); \ in RadixTests()
159 CHECK(RE("([0-7]+)[uUlL]*").FullMatch(#value, Octal(&v))); \ in RadixTests()
161 CHECK(RE("([0-9a-fA-FxX]+)[uUlL]*").FullMatch("0" #value, CRadix(&v))); \ in RadixTests()
185 CHECK(RE("(-?[0-9]+)[uUlL]*").FullMatch(#value, &v)); \ in RadixTests()
187 CHECK(RE("(-?[0-9a-fA-FxX]+)[uUlL]*").FullMatch(#value, CRadix(&v))); \ in RadixTests()
336 RE re(t->regexp, RE_Options(PCRE_NEWLINE_CRLF).set_utf8(support_utf8)); in TestReplace()
349 RE re("b*", RE_Options(PCRE_NEWLINE_CR).set_utf8(support_utf8)); in TestReplace()
356 RE re("b*", RE_Options(PCRE_NEWLINE_LF).set_utf8(support_utf8)); in TestReplace()
371 CHECK(RE("(.*)@([^.]*)").Extract("\\2!\\1", "boris@kremvax.ru", &s)); in TestExtract()
375 CHECK(RE(".*").Extract("'\\0'", "foo", &s)); in TestExtract()
377 CHECK(!RE("bar").Extract("'\\0'", "baz", &s)); in TestExtract()
389 RE r("\\s*(\\w+)"); // matches a word, possibly proceeded by whitespace in TestConsume()
405 RE r("(\\w+)"); // matches a word in TestFindAndConsume()
422 RE r("(foo)|(bar)|(baz)"); in TestMatchNumberPeculiarity()
438 CHECK(RE("(foo)|hello").FullMatch("hello", &a)); in TestMatchNumberPeculiarity()
455 RE re("(\\w+)*b", options_ml); in TestRecursion()
462 RE re2("(\\w+)*b", options_ml); in TestRecursion()
470 RE re3("(\\w+)*b", options_mlr); in TestRecursion()
477 RE re4("(\\w+)*b", options_mlr); in TestRecursion()
487 string quoted = RE::QuoteMeta(unquoted); in TestQuoteMeta()
488 RE re(quoted, options); in TestQuoteMeta()
496 string quoted = RE::QuoteMeta(unquoted); in NegativeTestQuoteMeta()
497 RE re(quoted, options); in NegativeTestQuoteMeta()
580 RE(regex,options).FullMatch(str, &captured); in GetOneOptionResult()
582 RE(regex,options).PartialMatch(str, &captured); in GetOneOptionResult()
602 CHECK(RE(regex,options).FullMatch(str)); in TestOneOption()
604 CHECK(RE(regex,options).PartialMatch(str)); in TestOneOption()
607 CHECK(!RE(regex,options).FullMatch(str)); in TestOneOption()
609 CHECK(!RE(regex,options).PartialMatch(str)); in TestOneOption()
713 RE re("(world|universe)$", options); in Test_NO_AUTO_CAPTURE()
788 RE orig("HELLO.*world", options); in TestConstructors()
791 RE copy1(orig); in TestConstructors()
794 RE copy2("not a match"); in TestConstructors()
844 CHECK(RE("h.*o").FullMatch("hello")); in main()
845 CHECK(!RE("h.*o").FullMatch("othello")); // Must be anchored at front in main()
846 CHECK(!RE("h.*o").FullMatch("hello!")); // Must be anchored at end in main()
847 CHECK(RE("a*").FullMatch("aaaa")); // Fullmatch with normal op in main()
848 CHECK(RE("a*?").FullMatch("aaaa")); // Fullmatch with nongreedy op in main()
849 CHECK(RE("a*?\\z").FullMatch("aaaa")); // Two unusual ops in main()
854 CHECK(RE("\\d+").FullMatch("1001")); in main()
857 CHECK(RE("(\\d+)").FullMatch("1001", &i)); in main()
859 CHECK(RE("(-?\\d+)").FullMatch("-123", &i)); in main()
861 CHECK(!RE("()\\d+").FullMatch("10", &i)); in main()
862 CHECK(!RE("(\\d+)").FullMatch("1234567890123456789012345678901234567890", in main()
866 CHECK(RE("1(\\d*)4").FullMatch("1234", &i)); in main()
868 CHECK(RE("(\\d)\\d+").FullMatch("1234", &i)); in main()
870 CHECK(RE("(-\\d)\\d+").FullMatch("-1234", &i)); in main()
872 CHECK(RE("(\\d)").PartialMatch("1234", &i)); in main()
874 CHECK(RE("(-\\d)").PartialMatch("-1234", &i)); in main()
878 CHECK(RE("h(.*)o").FullMatch("hello", &s)); in main()
883 CHECK(RE("(\\w+):(\\d+)").FullMatch("ruby:1234", &sp, &i)); in main()
889 CHECK(RE("(\\w+):(\\d+)").FullMatch("ruby:1234", &s, &i)); in main()
894 CHECK(RE("he(.*)lo").FullMatch("hello", (char*)NULL)); in main()
895 CHECK(RE("h(.*)o").FullMatch("hello", (string*)NULL)); in main()
896 CHECK(RE("h(.*)o").FullMatch("hello", (StringPiece*)NULL)); in main()
897 CHECK(RE("(.*)").FullMatch("1234", (int*)NULL)); in main()
899 CHECK(RE("(.*)").FullMatch("1234567890123456", (long long*)NULL)); in main()
901 CHECK(RE("(.*)").FullMatch("123.4567890123456", (double*)NULL)); in main()
902 CHECK(RE("(.*)").FullMatch("123.4567890123456", (float*)NULL)); in main()
905 CHECK(!RE("h(.*)lo").FullMatch("hello", &s, (char*)NULL)); in main()
906 CHECK(!RE("(.*)").FullMatch("hello", (int*)NULL)); in main()
907 CHECK(!RE("(.*)").FullMatch("1234567890123456", (int*)NULL)); in main()
908 CHECK(!RE("(.*)").FullMatch("hello", (double*)NULL)); in main()
909 CHECK(!RE("(.*)").FullMatch("hello", (float*)NULL)); in main()
912 CHECK(RE("(\\w+)(:)(\\d+)").FullMatch("ruby:1234", &s, (void*)NULL, &i)); in main()
919 CHECK(RE("(H)ello").FullMatch("Hello", &c)); in main()
924 CHECK(RE("(H)ello").FullMatch("Hello", &c)); in main()
929 CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); in main()
930 CHECK(RE("(-?\\d+)").FullMatch("-100", &v)); CHECK_EQ(v, -100); in main()
931 CHECK(RE("(-?\\d+)").FullMatch("32767", &v)); CHECK_EQ(v, 32767); in main()
932 CHECK(RE("(-?\\d+)").FullMatch("-32768", &v)); CHECK_EQ(v, -32768); in main()
933 CHECK(!RE("(-?\\d+)").FullMatch("-32769", &v)); in main()
934 CHECK(!RE("(-?\\d+)").FullMatch("32768", &v)); in main()
938 CHECK(RE("(\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); in main()
939 CHECK(RE("(\\d+)").FullMatch("32767", &v)); CHECK_EQ(v, 32767); in main()
940 CHECK(RE("(\\d+)").FullMatch("65535", &v)); CHECK_EQ(v, 65535); in main()
941 CHECK(!RE("(\\d+)").FullMatch("65536", &v)); in main()
947 CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); in main()
948 CHECK(RE("(-?\\d+)").FullMatch("-100", &v)); CHECK_EQ(v, -100); in main()
949 CHECK(RE("(-?\\d+)").FullMatch("2147483647", &v)); CHECK_EQ(v, max_value); in main()
950 CHECK(RE("(-?\\d+)").FullMatch("-2147483648", &v)); CHECK_EQ(v, min_value); in main()
951 CHECK(!RE("(-?\\d+)").FullMatch("-2147483649", &v)); in main()
952 CHECK(!RE("(-?\\d+)").FullMatch("2147483648", &v)); in main()
957 CHECK(RE("(\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); in main()
958 CHECK(RE("(\\d+)").FullMatch("4294967295", &v)); CHECK_EQ(v, max_value); in main()
959 CHECK(!RE("(\\d+)").FullMatch("4294967296", &v)); in main()
975 CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100); in main()
976 CHECK(RE("(-?\\d+)").FullMatch("-100",&v)); CHECK_EQ(v, -100); in main()
979 CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value); in main()
982 CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value); in main()
987 CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); in main()
992 CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); in main()
1002 CHECK(RE("(-?\\d+)").FullMatch("100",&v)); CHECK_EQ(v, 100); in main()
1003 CHECK(RE("(-?\\d+)").FullMatch("-100",&v2)); CHECK_EQ(v2, -100); in main()
1006 CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value); in main()
1010 CHECK(!RE("(-?\\d+)").FullMatch(buf, &v)); in main()
1015 CHECK(RE("(.*)").FullMatch("100", &v)); in main()
1016 CHECK(RE("(.*)").FullMatch("-100.", &v)); in main()
1017 CHECK(RE("(.*)").FullMatch("1e23", &v)); in main()
1021 CHECK(RE("(.*)").FullMatch("100", &v)); in main()
1022 CHECK(RE("(.*)").FullMatch("-100.", &v)); in main()
1023 CHECK(RE("(.*)").FullMatch("1e23", &v)); in main()
1027 CHECK(!RE("(\\d+)").FullMatch("x1001", &i)); in main()
1028 CHECK(!RE("(\\d+)").FullMatch("1001x", &i)); in main()
1029 CHECK(RE("x(\\d+)").FullMatch("x1001", &i)); CHECK_EQ(i, 1001); in main()
1030 CHECK(RE("(\\d+)x").FullMatch("1001x", &i)); CHECK_EQ(i, 1001); in main()
1033 CHECK(RE("[0-9a-f+.-]{5,}").FullMatch("0abcd")); in main()
1034 CHECK(RE("[0-9a-f+.-]{5,}").FullMatch("0abcde")); in main()
1035 CHECK(!RE("[0-9a-f+.-]{5,}").FullMatch("0abc")); in main()
1038 CHECK(RE("foo|bar|[A-Z]").FullMatch("foo")); in main()
1039 CHECK(RE("foo|bar|[A-Z]").FullMatch("bar")); in main()
1040 CHECK(RE("foo|bar|[A-Z]").FullMatch("X")); in main()
1041 CHECK(!RE("foo|bar|[A-Z]").FullMatch("XY")); in main()
1044 CHECK(RE("fo|foo").FullMatch("fo")); in main()
1045 CHECK(RE("fo|foo").FullMatch("foo")); in main()
1046 CHECK(RE("fo|foo$").FullMatch("fo")); in main()
1047 CHECK(RE("fo|foo$").FullMatch("foo")); in main()
1048 CHECK(RE("foo$").FullMatch("foo")); in main()
1049 CHECK(!RE("foo\\$").FullMatch("foo$bar")); in main()
1050 CHECK(!RE("fo|bar").FullMatch("fox")); in main()
1057 CHECK(!RE("foo$").PartialMatch("foo\n")); in main()
1062 CHECK(RE("").FullMatch("")); in main()
1065 CHECK(RE("(\\d){1}").FullMatch("1", in main()
1070 CHECK(RE("(\\d)(\\d)").FullMatch("12", in main()
1076 CHECK(RE("(\\d)(\\d)(\\d)").FullMatch("123", in main()
1083 CHECK(RE("(\\d)(\\d)(\\d)(\\d)").FullMatch("1234", in main()
1091 CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("12345", in main()
1101 CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("123456", in main()
1112 CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)").FullMatch("1234567", in main()
1124 CHECK(RE("(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)(\\d)" in main()
1152 CHECK(RE("h.*o").PartialMatch("hello")); in main()
1153 CHECK(RE("h.*o").PartialMatch("othello")); in main()
1154 CHECK(RE("h.*o").PartialMatch("hello!")); in main()
1155 CHECK(RE("((((((((((((((((((((x))))))))))))))))))))").PartialMatch("x")); in main()
1170 const RE re(kPattern); in main()
1176 RE re("foo"); in main()
1200 RE re_test1("........."); in main()
1202 RE re_test2("...", pcrecpp::UTF8()); in main()
1208 RE re_test3("(.)"); in main()
1211 RE re_test4("(.)", pcrecpp::UTF8()); in main()
1216 RE re_test5(utf8_string); in main()
1218 RE re_test6(utf8_string, pcrecpp::UTF8()); in main()
1222 RE re_test7(utf8_pattern); in main()
1224 RE re_test8(utf8_pattern, pcrecpp::UTF8()); in main()
1234 RE match_sentence(pattern); in main()
1235 RE match_sentence_re(pattern, pcrecpp::UTF8()); in main()
1244 RE match_sentence(pattern); in main()
1245 RE match_sentence_re(pattern, pcrecpp::UTF8()); in main()
1254 { RE re("a\\1"); CHECK(!re.error().empty()); } in main()
1256 RE re("a[x"); in main()
1260 RE re("a[z-a]"); in main()
1264 RE re("a[[:foobar:]]"); in main()
1268 RE re("a(b"); in main()
1272 RE re("a\\"); in main()