regular expression in python between two words
Question: I am trying to get value

    
    
    l1 = [u'/worldcup/archive/southafrica2010/index.html', u'/worldcup/archive/germany2006/index.html', u'/worldcup/archive/edition=4395/index.html', u'/worldcup/archive/edition=1013/index.html', u'/worldcup/archive/edition=84/index.html', u'/worldcup/archive/edition=76/index.html', u'/worldcup/archive/edition=68/index.html', u'/worldcup/archive/edition=59/index.html', u'/worldcup/archive/edition=50/index.html', u'/worldcup/archive/edition=39/index.html', u'/worldcup/archive/edition=32/index.html', u'/worldcup/archive/edition=26/index.html', u'/worldcup/archive/edition=21/index.html', u'/worldcup/archive/edition=15/index.html', u'/worldcup/archive/edition=9/index.html', u'/worldcup/archive/edition=7/index.html', u'/worldcup/archive/edition=5/index.html', u'/worldcup/archive/edition=3/index.html', u'/worldcup/archive/edition=1/index.html']
    

I'm trying to do regular expression starting off with something like this
below

    
    
    m = re.search(r"\d+", l)
    print m.group()
    

but I want value between "archive/" and "/index.html"  
I goggled and have tried something like
`(?<=archive/\/index.html).*(?=\/index.html:)`

but It didn't work for me .. how can I get my result list as '

    
    
    result = ['germany2006','edition=4395','edition=1013' , ...]
    


Answer: If you know for sure that the pattern will match always, you can use this

    
    
    import re
    print [re.search("archive/(.*?)/index.html", l).group(1) for l in l1]
    

Or you can simply split like this

    
    
    print [l.rsplit("/", 2)[-2] for l in l1]
    

