pattern = r"\d{4}/\d{2}/\d{2}" text_to_search = "The date of creation is 2019/03/12 and date of expiration is 2021/03/01" re.findall(pattern, text_to_search)
pattern = r"\d{4}/\d{2}/\d{2}" text_to_search = "The date of creation is 2019/03/12 and date of expiration is 2021/03/01" re.findall(pattern, text_to_search)