re.py
changeset 93 4794759139ea
parent 92 e85600529ca5
child 94 9ea667baf097
equal deleted inserted replaced
92:e85600529ca5 93:4794759139ea
     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)