how to use python re.sub()?

import re

re.sub(‘[a-zA-Z0-9/*\n\u]’, ”, string=’\n\u3000\u3000xyz’)

error:

  File "<input>", line 2
    re.sub('[a-zA-Z0-9/*\n\u]', '', string='\n\u3000\u3000xyz')
                              ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 14-15: truncated \uXXXX escape

I want to delete ‘\u’ in string’\n\u3000\u3000xyz’, but it didn’t work.

Leave a Reply

Your email address will not be published.