I have the following file names that exhibit this pattern:
000014_L_20111007T084734-20111008T023142.txt 000014_U_20111007T084734-20111008T023142.txt ...
>>> f='000014_L_20111007T084734-20111008T023142.txt' >>> f[10:-4].split('-') ['0111007T084734', '20111008T023142']
or, somewhat more general:
>>> f[f.rfind('_')+1:-4].split('-') ['20111007T084734', '20111008T023142']