Last active
January 11, 2018 08:47
-
-
Save msysyamamoto/e92b240eb3f2e150d23787ec16e1cb28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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