[New-bugs-announce] [issue2650] re.escape should not escape underscore

Russ Cox report at bugs.python.org
Thu Apr 17 16:14:10 CEST 2008

New submission from Russ Cox <rsc at swtch.com>:

import re
print re.escape("_")

Prints \_ but should be _.

This behavior differs from Perl and other systems: _ is an identifier
character and as such does not need to be escaped.

messages: 65585
nosy: rsc
severity: normal
status: open
title: re.escape should not escape underscore
type: behavior
versions: Python 2.5

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list