progs/catastrophic.py
author Christian Urban <urbanc@in.tum.de>
Sun, 21 Aug 2016 18:15:53 +0200
changeset 411 1aec0e1fda86
parent 93 progs/re.py@4794759139ea
child 420 25bc57b32efa
permissions -rwxr-xr-x
updated catastrophic examples

#!/usr/bin/env python
import re
import sys

cn = sys.argv[1]

r1 = '((a?){%s})' % cn
r2 = 'a{%s}' % cn

m = re.match(r1 + r2 , "a" * int(cn)) 

print m.group(0)