From this post I found how to remove everything from a text than spaces and alphanumeric: Python: Strip everything but spaces and alphanumeric.
In this way:
re.sub(r'([^\s\w]|_)+', '', document)
I wanted basically to remove all the special characters.
However, now I want to do the same (i.e. to remove all the special characters) but without removing the following special characters:
- \n
- /
How do I do this?