programming-examples/python/Regular_Expression/Check for a number at the end of a string.py
2019-11-15 12:59:38 +01:00

10 lines
223 B
Python

import re
def end_num(string):
text = re.compile(r".*[0-9]$")
if text.match(string):
return True
else:
return False
print(end_num('abcdef'))
print(end_num('abcdef6'))