mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #23622: Unknown escapes in regular expressions that consist of `'\'
`
and ASCII letter now raise a deprecation warning and will be forbidden in Python 3.6.
This commit is contained in:
parent
793c14ea29
commit
a54aae0683
6 changed files with 60 additions and 19 deletions
|
@ -1138,7 +1138,7 @@ Empty matches are replaced only when they're not adjacent to a previous match.
|
|||
|
||||
If *replacement* is a string, any backslash escapes in it are processed. That
|
||||
is, ``\n`` is converted to a single newline character, ``\r`` is converted to a
|
||||
carriage return, and so forth. Unknown escapes such as ``\j`` are left alone.
|
||||
carriage return, and so forth. Unknown escapes such as ``\&`` are left alone.
|
||||
Backreferences, such as ``\6``, are replaced with the substring matched by the
|
||||
corresponding group in the RE. This lets you incorporate portions of the
|
||||
original text in the resulting replacement string.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue