Skip to content

Instantly share code, notes, and snippets.

@lbr88
Last active March 12, 2024 19:33
Show Gist options
  • Save lbr88/40e6ec548d19920def1579c31fd957df to your computer and use it in GitHub Desktop.
Save lbr88/40e6ec548d19920def1579c31fd957df to your computer and use it in GitHub Desktop.
import clipboard
import re
raw = clipboard.paste()
p = re.compile('.*\/\/([0-9]+)>(.*) » (.*) - .*$')
output = ""
for l in raw.splitlines():
m = p.match(l)
if m != None:
output += "{0} {1} --> {2}\n".format(m.group(1),m.group(2),m.group(3))
if output != "":
clipboard.copy(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment