Does anyone have an idea on how to convert the following commands into one or fewer commands?
variable = re.search("[a-zA-Z0-9]+[a-zA-Z0-9\-' ]+[a-zA-Z0-9]+", variable).group(0)
variable = re.sub(" {2,}", " ", variable)
variable = re.sub("'{2,}", "'", variable)
variable = re.sub("\-{2,}", "-", variable)
Kind Regards,
Marian