[Tutor] problem regarding re

Manprit Singh manpritsinghece at gmail.com
Wed Jan 27 11:21:19 EST 2021


Dear Sir ,

Consider a problem given below

re.sub(r'\\', "", 'acd\m')

gives the output = acdm as re.sub will replace the "\" in "acd\m" with "" .

but when i am doing  re.sub(r'\\', "", 'acd\b') why is it not replacing "\"
with "". why i am getting the answer as 'acd\x08' .  How can I get acdb ?
kindly put some light on it.

Thanks
Manprit Singh


More information about the Tutor mailing list