New submission from Lottie Price <lpr...@parc.com>:

Problem:

re.match("\\-", "\\-")

returns None.
I expected a match.

Context:

I have some random text strings I want to match against. I'm using re.escape() 
to ensure that the text characters are not interpreted as special characters:
      re.match(re.escape("-"), re.escape("-"))

As a result, strings with hyphens are coming back as above, and are not 
matching.

----------
components: Regular Expressions
messages: 337272
nosy: ezio.melotti, lprice, mrabarnett
priority: normal
severity: normal
status: open
title: re.match() not matching escaped hyphens
type: behavior
versions: Python 3.6

_______________________________________
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

Reply via email to