Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

re date python

# re date validate/extract particular dd/mm/yyyy
s= 24-12-2021
l = re.compile("^(?P<date>[0-9]{2})-(?P<month>[0-9]{2})-(?P<year>[0-9]{4})$")
m = re.search(r,s)
if m:
  print(m.group("year"))
else:
  print("pattern not found")
 
PREVIOUS NEXT
Tagged: #date #python
ADD COMMENT
Topic
Name
8+4 =