Skip to content

Instantly share code, notes, and snippets.

@kuenishi
Created July 11, 2020 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuenishi/994526ce4512e143eb7ae4fc3d2ffcd1 to your computer and use it in GitHub Desktop.
Save kuenishi/994526ce4512e143eb7ae4fc3d2ffcd1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import re
import sys
filename = sys.argv[1]
pattern = r"(https://youtu\.be/[a-zA-Z0-9_-]*)"
with open(filename, 'r') as fp:
for line in fp.readlines():
for match in re.findall(pattern, line):
assert 28 == len(match)
print(match)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment