import re
look = r'Template.11_31.Single-Volume'
pattern = r'11.31'
match = re.search(pattern,look)
print re.findall(pattern,look)
if (match is not None):
print match.group(0)
Answer:
['11_31']
11_31
I want it to match 11.31 or 1131 but here it also matches 11_31