I am trying to make a Python regex which allows me to remove all worlds of a string containing a number.
For example:
in = \"ABCD abcd AB55 55CD A55D
Here's my approach:
>>> import re >>> s = "ABCD abcd AB55 55CD A55D 5555" >>> re.sub("\S*\d\S*", "", s).strip() 'ABCD abcd' >>>