How would I do this in python3?
The quick brown fox jumps over the lazy dog.
to...
The quick brown fox jumps over the lazy dog.
Where the above quote is a string.
You don't need to use regex
here. You can achieve what you want like this ways:
a = "The quick brown fox jumps over the lazy dog."
final = " ".join(a.split())
print(final)
Output:
'The quick brown fox jumps over the lazy dog.'