[docs] [issue12162] Documentation about re \number

Ezio Melotti report at bugs.python.org
Sun May 29 04:01:01 CEST 2011

Ezio Melotti <ezio.melotti at gmail.com> added the comment:

The regex sets (\d\w\s\D\W\S) don't match any Python escape sequence, so even if some suggest to always use r'' regardless, I don't find it necessary, especially for simple regexs.
The two conflicting escape sequences to keep in mind are \b (backspace for Python, word boundary for re) and \number (octal escape for Python, reference to a group for re).
There are also other regex escape sequences that are rarely used (\B\A\Z), but these don't need to be escaped either.


Python tracker <report at bugs.python.org>

More information about the docs mailing list