Пример #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")