Given an array of strings which contains alphanumeric characters but also punctuations that have to be deleted. For instance the string x="0-001" is converted into x="0001".
For this purpose I have:
punctuations = list(string.punctuation)
Which contain all the characters that have to be removed from the strings. I'm trying to solve this using regular expressions in python, any suggestion on how to proceed using regular expressions?
import string
punctuations = list(string.punctuation)
test = "0000.1111"
for i, char in enumerate(test):
if char in punctuations:
test = test[:i] + test[i+ 1:]