假设我有一个字符串,例如:
string = 'This string 22 is not yet perfect1234 and 123pretty but it can be.'
Run Code Online (Sandbox Code Playgroud)
我想从我的字符串中删除任何与单词混合的数字,例如'perfect1234'and '123pretty',但不是 '22',并获得如下输出:
string = 'This string 22 is not yet perfect and pretty but it can be.'
Run Code Online (Sandbox Code Playgroud)
有没有办法使用正则表达式或任何其他方法在 Python 中做到这一点?任何帮助,将不胜感激。谢谢!