# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(?=[a-zA-Z0-9\/ \.\-]+\/\/:ptth) \."
test_str = "nospmiS maC retroper lanruoJ teertS llaW edulcni repapswen eht fo inmula elbatoN lmths .7665401-09.snruT .sweN-ehT/sweN/40/11/5002/swen/903repap/egarots/aidem/moc .swenned .www .aidem//:ptth .0891 ni nesohc saw eman tnerruc sti erofeb sweN etatS nretsaE dna sweN egelloC s'rehcaeT demaner saw repap ehT .repapswen yliad a evah ot yrtnuoc eht ni seitisrevinu tsellams eht fo eno si dna 2999031 .1-sserp-lles-ot-setov-draob-aidem-tneduts/seirots-pot/moc .enilnonaxetyliad .www//:ptth sserp gnitnirp repapswen nwo sti nur ot setatS detinU eht ni seitisrevinu eerht ylno fo eno si ytisrevinU sionillI nretsaE"
subst = "."
# You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.MULTILINE)
if result:
print (result)
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html