fork download
  1. import re
  2.  
  3. regex = r"(((?<=### http:\/\/archive\.semantyk\.com\/).*)|(?<=archive:)([^\s]+))"
  4.  
  5. test_str = ("### http://a...content-available-to-author-only...k.com/ test\n"
  6. "archive:test")
  7.  
  8. subst = "186e4707_afc8_4d0d_8c56_26e595eba8f0"
  9.  
  10. result = re.sub(regex, subst, test_str, 0)
  11. print (result)
  12.  
  13.  
Success #stdin #stdout 0.02s 9412KB
stdin
Standard input is empty
stdout
### http://a...content-available-to-author-only...k.com/186e4707_afc8_4d0d_8c56_26e595eba8f0
archive:186e4707_afc8_4d0d_8c56_26e595eba8f0