Ezio Melotti <ezio.melo...@gmail.com> added the comment: This happens because \A, \B and \Z are valid escape sequences[0]. If what you mean is that they shouldn't be recognized as such inside a character class, then I can agree with that. ^ and $ are similar to \A and \Z but they are considered as literals inside []. I think the same could also be applied to \b and \B, unless you expect r'[\b]' to match the same as r'\b'.
(On an unrelated note, it's preferable to avoid using ints as flag -- using re.DEBUG is better) [0]: http://docs.python.org/library/re.html#regular-expression-syntax ---------- nosy: +ezio.melotti, mrabarnett _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13899> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com