I want to remove all commas from a string using regular expressions, I want letters, periods and numbers to remain just commas
Why a regex?
mystring = mystring.replace(",", "")
is enough.
Of course, if you insist:
mystring = re.sub(",", "", mystring)
but that's probably an order of magnitude slower.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With