progs/re.py
changeset 93 4794759139ea
parent 49 d2c6852ca8da
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/progs/re.py	Sat Jun 15 09:23:18 2013 -0400
@@ -0,0 +1,12 @@
+#!/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)