I want to remove all special char such as '|', '.' or '$' in the string.
Here is my code:
string= '#$#&^&#$@||||123515'
re.sub(r'[^a-zA-Z0-9]', '', string)
print(string)
the output:
#$#&^&#$@||||123515
I know this regex means removing everything but number, a-z and A-Z.
But it fails to remove all special char.
Can somebody tell me why? Thank you! :)