Skip to content

Instantly share code, notes, and snippets.

@msysyamamoto
Last active January 11, 2018 08:47
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 msysyamamoto/e92b240eb3f2e150d23787ec16e1cb28 to your computer and use it in GitHub Desktop.
Save msysyamamoto/e92b240eb3f2e150d23787ec16e1cb28 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
RED = '\033[31m'
END = '\033[0m'
BOLD = '\033[1m'
def emphasis_print(text):
print(RED + BOLD + text + END)
while True:
line = sys.stdin.readline()
if not line: break # EOF
l = line.splitlines()[0]
match = re.search('^\s+[^:]+:\s+"([^"]*)"\s=>\s"([^"]*)"', l)
if match is None:
print(l)
continue
left, right = match.groups()
if left == right:
print(l)
continue
emphasis_print(l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment