STINNER Victor <vstin...@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 <rep...@bugs.python.org> <https://bugs.python.org/issue39624> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com