What is the best way to remove words in a string that start with numbers and contain periods in Python?
this_string = 'lorum3 ipsum 15.2.3.9.7 bar foo 1. v more text 46 2. here and even more text here v7.8.989'
If I use Regex:
re.sub('[0-9]*\.\w*', '', this_string)
The result will be:
'lorum3 ipsum bar foo v more text 46 here and even more text here v'
I'm expecting the word v7.8.989
not to be removed, since it's started with a letter.
It will be great if the removed words aren't adding the unneeded space. My Regex code above still adds space.