As part of a bigger code I am trying to check if a string(filename) ends with ".number" However, re.match (re.compile and match) just wont match the pattern at end of the string.
Code:
import re
f = ".1.txt.2"
print re.match('\.\d$',f)
Output:
>>> print re.match('\.\d$',f)
None
Any help will be much appreciated !