# your code goes here
import re
string = '\\\\r \\\\nLove the filtered water \rand crushed ice in the door.'
new_string = re.sub(r"\\[rtnfv]|\[tnrfv]"," ",string)
print(new_string)
# if i use print(), \r is erased. however, the actual value of new_string is as below.
#>> '\\ \\ Love the filtered water \rand crushed ice in the door.'
# we still can see '\rand'.
# so i'm gonna stick with using re.sub(r"[\t\n\r\f\v]"," ",string) style!rather than re.sub(r"\\[rtnfv]|\[tnrfv]"," ",string)
# because this code has no problem. but i was just curious why re.sub(r"[\t\n\r\f\v]"," ",string) style doesn't work.. seems like it should work
# thanks for your explanation sir! as a newbie.. this is really helpful :)
IyB5b3VyIGNvZGUgZ29lcyBoZXJlCgoKCgppbXBvcnQgcmUKc3RyaW5nID0gJ1xcXFxyIFxcXFxuTG92ZSB0aGUgZmlsdGVyZWQgd2F0ZXIgXHJhbmQgY3J1c2hlZCBpY2UgaW4gdGhlIGRvb3IuJwpuZXdfc3RyaW5nID0gcmUuc3ViKHIiXFxbcnRuZnZdfFxbdG5yZnZdIiwiICIsc3RyaW5nKQoKcHJpbnQobmV3X3N0cmluZykgCiMgaWYgaSB1c2UgcHJpbnQoKSwgXHIgaXMgZXJhc2VkLiBob3dldmVyLCB0aGUgYWN0dWFsIHZhbHVlIG9mIG5ld19zdHJpbmcgaXMgYXMgYmVsb3cuCiM+PiAnXFwgIFxcIExvdmUgdGhlIGZpbHRlcmVkIHdhdGVyIFxyYW5kIGNydXNoZWQgaWNlIGluIHRoZSBkb29yLicKIyB3ZSBzdGlsbCBjYW4gc2VlICdccmFuZCcuCiMgc28gaSdtIGdvbm5hIHN0aWNrIHdpdGggdXNpbmcgIHJlLnN1YihyIltcdFxuXHJcZlx2XSIsIiAiLHN0cmluZykgc3R5bGUhcmF0aGVyIHRoYW4gcmUuc3ViKHIiXFxbcnRuZnZdfFxbdG5yZnZdIiwiICIsc3RyaW5nKSAKIyBiZWNhdXNlIHRoaXMgY29kZSBoYXMgbm8gcHJvYmxlbS4gYnV0IGkgd2FzIGp1c3QgY3VyaW91cyB3aHkgcmUuc3ViKHIiW1x0XG5cclxmXHZdIiwiICIsc3RyaW5nKSBzdHlsZSBkb2Vzbid0IHdvcmsuLiBzZWVtcyBsaWtlIGl0IHNob3VsZCB3b3JrCiMgdGhhbmtzIGZvciB5b3VyIGV4cGxhbmF0aW9uIHNpciEgYXMgYSBuZXdiaWUuLiB0aGlzIGlzIHJlYWxseSBoZWxwZnVsIDop