progs/re.py
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Sat, 05 Oct 2013 00:56:06 +0100
changeset 126 7c7185cb4f2b
parent 93 4794759139ea
permissions -rwxr-xr-x
added

#!/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)