Answers for "regex remove non alphanumeric python"

6

python regex replace all non alphanumeric characters

import re

s = re.sub('[^0-9a-zA-Z]+', '*', s)
Posted by: Guest on March-08-2021
2

python string strip non alphanumeric

Regular expressions to the rescue:

import re
stripped_string = re.sub(r'\W+', '', your_string)
Posted by: Guest on February-05-2020

Code answers related to "regex remove non alphanumeric python"

Python Answers by Framework

Browse Popular Code Answers by Language