re.py
changeset 49 d2c6852ca8da
equal deleted inserted replaced
48:ddd357703b6c 49:d2c6852ca8da
       
     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)