You don’t need regular expressions. Python has a built-in string method that does what you need:
mystring.replace(" ", "_")
You don’t need regular expressions. Python has a built-in string method that does what you need:
mystring.replace(" ", "_")