mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #16688: Fix backreferences did make case-insensitive regex fail on non-ASCII strings.
Patch by Matthew Barnett.
This commit is contained in:
parent
2d8298dcd2
commit
c1b59d4552
4 changed files with 15 additions and 5 deletions
|
@ -968,6 +968,11 @@ class ReTests(unittest.TestCase):
|
|||
self.assertEqual(r, s)
|
||||
self.assertEqual(n, size + 1)
|
||||
|
||||
def test_bug_16688(self):
|
||||
# Issue 16688: Backreferences make case-insensitive regex fail on
|
||||
# non-ASCII strings.
|
||||
self.assertEqual(re.findall(r"(?i)(a)\1", "aa \u0100"), ['a'])
|
||||
self.assertEqual(re.match(r"(?s).{1,3}", "\u0100\u0100").span(), (0, 2))
|
||||
|
||||
def run_re_tests():
|
||||
from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue