[issue39624] Trace greedy replaces $prefix and $exec_prefix

STINNER Victor report at bugs.python.org
Thu Feb 13 08:41:49 EST 2020


STINNER Victor <vstinner at python.org> added the comment:

str.replace() can be replaced with re.sub() and \b marker.

Example:

>>> re.sub(r'\$prefix\b', '[xxx]', '$prefix $prefixpath')
'[xxx] $prefixpath'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39624>
_______________________________________


More information about the Python-bugs-list mailing list