Skip to content

Instantly share code, notes, and snippets.

@PlethoraChutney
Created October 19, 2022 20:33
Show Gist options
  • Save PlethoraChutney/4e9237187a99427a867974fba567af8d to your computer and use it in GitHub Desktop.
Save PlethoraChutney/4e9237187a99427a867974fba567af8d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import re
import sys
char_pattern = re.compile('color:#7f7f7f[^>]*>([^<]*)')
with open(sys.argv[1], 'r') as f:
lines = [x.rstrip() for x in f]
line = ''.join(lines)
match = re.findall(char_pattern, line)
print(''.join([x.upper() for x in match]).replace(' ', ''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment