Пример #1
0
 def test_fullmatch_assertion(self):
     r = get_code(r"(?=a).b")
     assert fullmatch(r, "ab")
     r = get_code(r"(?!a)..")
     assert not fullmatch(r, "ab")
Пример #2
0
 def test_fullmatch_2(self):
     r = get_code(r"a(b*?)")
     match = fullmatch(r, "abbb")
     assert match.group(1) == "bbb"
     assert not fullmatch(r, "abbbc")
Пример #3
0
 def test_fullmatch_4(self):
     r = get_code(r"a((bp)*)c")
     match = fullmatch(r, "abpbpbpc")
     assert match.group(1) == "bpbpbp"
Пример #4
0
 def test_fullmatch_1(self):
     r = get_code(r"ab*c")
     assert not fullmatch(r, "abbbcdef")
     assert fullmatch(r, "abbbc")