0

On trying to replace every thing except numbers and alphabets with a blank ,Some characters could not be replaced ! Specifically : ^ _ [] \

It even adds one more back slash , it might be due to it being a escape character .

But I am still confused why are these not replaced ?

import re
re.sub('[^0-9A-z]',' ',"Why are  ~!@#$$%^&*()_+{}[]:|;'\? Not replaced here ?")
Thunder
  • 9,775
  • 25
  • 79
  • 113

0 Answers0