This module provides a facility to convert regular expressions from the
syntax used by the deprecated regex module to those used by the
newer re module. Because of similarity between the regular
expression syntax of sed(1)
and emacs(1)
and the
regex module, it is also helpful to convert patterns written for
those tools to re patterns.
When used as a script, a Python string literal (or any other expression
evaluating to a string) is read from stdin, and the translated expression is
written to stdout as a string literal. Unless stdout is a tty, no trailing
newline is written to stdout. This is done so that it can be used with
Emacs C-U M-|
(shell-command-on-region) which filters the region
through the shell command.
See Also: