progs/re.py
changeset 411 1aec0e1fda86
parent 410 3e1b8266ea65
child 412 1cef3924f7a2
equal deleted inserted replaced
410:3e1b8266ea65 411:1aec0e1fda86
     1 #!/usr/bin/env python
       
     2 import re
       
     3 import sys
       
     4 
       
     5 cn = sys.argv[1]
       
     6 
       
     7 r1 = '((a?){%s})' % cn
       
     8 r2 = 'a{%s}' % cn
       
     9 
       
    10 m = re.match(r1 + r2 , "a" * int(cn)) 
       
    11 
       
    12 print m.group(0)