I have a input string 12345678901234567890 and I want to use re.sub to match 10th digits to 15th digits in the above string, and replace with * so the desired output will need to be 1234567890*****67890.
import re
string="12345678901234567890"
out = re.sub(".{10}\d{5}.{5}","*",string)
print(out)
Above is my current code, which is not working as expected. Does anyone has an idea on this? Any help would be appreciated.