You don’t need a regular expression for that. I would do
string = "What $noun$ is $verb$?"
print string.replace("$noun$", "the heck")
Only use regular expressions when needed. It’s generally slower.
You don’t need a regular expression for that. I would do
string = "What $noun$ is $verb$?"
print string.replace("$noun$", "the heck")
Only use regular expressions when needed. It’s generally slower.