fork download
  1. import re
  2.  
  3. s= ' Get exciting offers when you book a XX year car June XX - XXXX Click here to book http://a...content-available-to-author-only...c.in/XXzOK '
  4. s = re.sub(r"(https?://[^/\s]+/)(\S+)", lambda x: x.group(1) + 'X' * len(x.group(2)), s)
  5.  
  6. print(s)
Success #stdin #stdout 0.03s 9604KB
stdin
Standard input is empty
stdout
 Get exciting offers when you book a XX year car   June XX - XXXX Click here to book http://a...content-available-to-author-only...c.in/XXXXX