Suppose I have a string such as :
string = 'This string 22 is not yet perfect1234 and 123pretty but it can be.'
I want to remove any numbers which are mixed with words, such as 'perfect1234'
and '123pretty'
, but not '22'
, from my string and get an output as follows:
string = 'This string 22 is not yet perfect and pretty but it can be.'
Is there any way to do this in Python using regex or any other method? Any help would be appreciated. Thank you!