In python, how to extract some char from each item of a list ?
e.g. in a list, each item (modelName) has
cfn99e1195_1.lp
The numbers inside may be different.
I need to get 99 and 1195.
I tried
findN = modelName.find('n')
findE = modelName.find('e')
nodeNum = modelName(findN, findE)
findBar = modelName.find('_')
arcNum = modelName(findE, findBar)
does not work.
thanks
consider using regular expressions: