I would like to replace words in a string sentence such as:
What $noun$ is $verb$?
What\'s the regular expression to replace the characters
In [1]: import re In [2]: re.sub('\$noun\$', 'the heck', 'What $noun$ is $verb$?') Out[2]: 'What the heck is $verb$?'