Skip to content

Instantly share code, notes, and snippets.

@froop
Created December 26, 2021 06:51
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 froop/6d53bc9cc973b24436e37a35d62ae186 to your computer and use it in GitHub Desktop.
Save froop/6d53bc9cc973b24436e37a35d62ae186 to your computer and use it in GitHub Desktop.
[Python] 正規表現サンプル
import re
with open('/content/drive/MyDrive/input.tsv') as file:
for line in file:
res = re.match('^([^\t]+)\t([^\t]+)\t.{3}([^\t]+)\t([^\t]+)$', line)
print('%s\t%s\t%s' % (res.group(2), res.group(4), bytes.fromhex(res.group(3))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment