Anish Shah added the comment: We just need to use '\-' instead of '-'.
``` >>> regex = re.compile("[a-z]") >>> bool(regex.match('b')) True >>> regex = re.compile("[a\-z]") >>> bool(regex.match('b')) False ``` I have uploaded a patch. Let me know if this needs some tests too? ---------- keywords: +patch Added file: http://bugs.python.org/file41836/issue26302_20160206.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26302> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com