Skip to content

Instantly share code, notes, and snippets.

@brettkelly
Created August 21, 2013 04:28
Show Gist options
  • Save brettkelly/6290319 to your computer and use it in GitHub Desktop.
Save brettkelly/6290319 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import re, sys
input = '%clipboard'
r = re.compile("!\[\]\(images\/([^.]+).png\)")
m = r.match(input)
if m:
outp = "<$img:%s>" % m.groups()[0]
else:
outp = input
sys.stdout.write(outp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment