import re
my_string="Your birth day is on 24-12-2002"
dt=re.search("([0-9]{2}\-[0-9]{2}\-[0-9]{4})", my_string)
print(dt[1])
Output is here
24-12-2002
Links ( URLs) from a file
import re
path='C:/dir_name/string_functions.php' # path of the file to read
fob=open(path,'r') # Open in read mode
data=fob.read() # collect data
fob.close() # close file object
#print(data)
urls1 = re.findall(r'href=[\'"]?([^\'" >]+)', data)
print(urls1)