import re
s = "hello,2021/11/54, world"
ans = re.search('[0-9]{4}/[0-9]{2}/[0-9]{2}' ,s)
if ans is None:
print("no match")
else:
print(ans.group())
i want to match date from the given string but i does not want to match for months value greater than 12 and day value greater than 31 how to do this so far i have tried this and it works perfectly fine. date is in format YYYY/MM/DD