AdminLaboratory: ctm

File ctm, 342 bytes (added by dfasnacht, 7 years ago)
Line 
1#!/usr/bin/env python2.7
2
3import sys
4import re
5
6for x in sys.stdin:
7    x = re.sub(r"([^'])''([^'])", r"\1\2", x)
8    x = re.sub(r"^''([^'])", r"\1", x)
9    x = re.sub(r"([^'])''$", r"\1", x)
10    x = re.sub(r"([^'])'''''([^'])", r"\1'''\2", x)
11    x = re.sub(' +', ' ', x)
12    #x = re.sub(r'\[\[BR\]\]', '[[BR]]', x, flags=re.I)
13    print x,