Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
You don't escape the text you are searching. Try this: py> re.match(re.escape('-'), "-") <_sre.SRE_Match object; span=(0, 1), match='-'> py> re.match(re.escape('a-c'), "a-c") <_sre.SRE_Match object; span=(0, 3), match='a-c'> ---------- nosy: +steven.daprano _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36206> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com