#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/sre_parse.py b/Lib/sre_parse.py
index 9aea56a..19dd4fc 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -235,7 +235,7 @@
     if code:
         return code
     code = CATEGORIES.get(escape)
-    if code:
+    if code and code[0] == IN:
         return code
     try:
         c = escape[1:2]