What is the best way to strip all non alphanumeric characters from a string, using Python?
The solutions presented in the PHP variant of this question will probably
>>> import re >>> string = "Kl13@£$%[};'\"" >>> pattern = re.compile('\W') >>> string = re.sub(pattern, '', string) >>> print string Kl13