import re
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 '
formatting = [
[r"http://a...content-available-to-author-only...c.in/\S*", "http://a...content-available-to-author-only...c.in/XXXX"]
]
for regex, substitution in formatting:
s = re.sub(regex, substitution, s)
print(s)
aW1wb3J0IHJlCgpzPSAnIEdldCBleGNpdGluZyBvZmZlcnMgd2hlbiB5b3UgYm9vayBhIFhYIHllYXIgY2FyICAgSnVuZSBYWCAtIFhYWFggQ2xpY2sgaGVyZSB0byBib29rIGh0dHA6Ly9hLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5jLmluL1hYek9LICcKCmZvcm1hdHRpbmcgPSBbCiAgICBbciJodHRwOi8vYS4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4uYy5pbi9cUyoiLCAiaHR0cDovL2EuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLmMuaW4vWFhYWCJdCl0KCmZvciByZWdleCwgc3Vic3RpdHV0aW9uIGluIGZvcm1hdHRpbmc6CiAgICBzID0gcmUuc3ViKHJlZ2V4LCBzdWJzdGl0dXRpb24sIHMpCiAgICBwcmludChzKQ==