How can I remove numbers, and words with length below 2, from a sentence?
You may use:
s = re.sub(r'\b(?:\d+|\w)\b\s*', '', s)
RegEx Demo
Pattern Details:
\b
: Match word boundary(?:\d+|\w)
: Match a single word character or 1+ digits\b
: Match word boundary\s*
: Match 0 or more whitespaces