#13899: \A, \Z, and \B now correctly match the A, Z, and B literals when used inside character classes (e.g. [A]). Patch by Matthew Barnett.
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 70702e6..dee5efe 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -821,6 +821,12 @@
# Test behaviour when not given a string or pattern as parameter
self.assertRaises(TypeError, re.compile, 0)
+ def test_bug_13899(self):
+ # Issue #13899: re pattern r"[\A]" should work like "A" but matches
+ # nothing. Ditto B and Z.
+ self.assertEqual(re.findall(r'[\A\B\b\C\Z]', 'AB\bCZ'),
+ ['A', 'B', '\b', 'C', 'Z'])
+
@precisionbigmemtest(size=_2G, memuse=1)
def test_large_search(self, size):
# Issue #10182: indices were 32-bit-truncated.