示例#1
0
 def test_fullmatch_assertion(self):
     r = get_code(r"(?=a).b")
     assert rsre_core.fullmatch(r, "ab")
     r = get_code(r"(?!a)..")
     assert not rsre_core.fullmatch(r, "ab")
示例#2
0
 def test_fullmatch_2(self):
     r = get_code(r"a(b*?)")
     match = rsre_core.fullmatch(r, "abbb")
     assert match.group(1) == "bbb"
     assert not rsre_core.fullmatch(r, "abbbc")
示例#3
0
 def test_fullmatch_4(self):
     r = get_code(r"a((bp)*)c")
     match = rsre_core.fullmatch(r, "abpbpbpc")
     assert match.group(1) == "bpbpbp"
示例#4
0
 def test_fullmatch_1(self):
     r = get_code(r"ab*c")
     assert not rsre_core.fullmatch(r, "abbbcdef")
     assert rsre_core.fullmatch(r, "abbbc")
示例#5
0
 def test_fullmatch_assertion(self):
     r = get_code(r"(?=a).b")
     assert rsre_core.fullmatch(r, "ab")
     r = get_code(r"(?!a)..")
     assert not rsre_core.fullmatch(r, "ab")
示例#6
0
 def test_fullmatch_4(self):
     r = get_code(r"a((bp)*)c")
     match = rsre_core.fullmatch(r, "abpbpbpc")
     assert match.group(1) == "bpbpbp"
示例#7
0
 def test_fullmatch_2(self):
     r = get_code(r"a(b*?)")
     match = rsre_core.fullmatch(r, "abbb")
     assert match.group(1) == "bbb"
     assert not rsre_core.fullmatch(r, "abbbc")
示例#8
0
 def test_fullmatch_1(self):
     r = get_code(r"ab*c")
     assert not rsre_core.fullmatch(r, "abbbcdef")
     assert rsre_core.fullmatch(r, "abbbc")