human
Python: trying to lower a string and remove non-alphanumeric characters aside from space
assistant
Here is some code to remove all non-alphanumeric characters except space from a string `text` and lower it

re.sub('(?!\\s)[\\W_]', '', text).lower().strip()

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.