import re
bday = input("Please enter your date of birth(mm/dd/yyyy): ")
m = re.findall("^\d{2}+\/+\d{2}+\/+\d{4}$", bday)
if m:
print (m)
else:
print ("Invalid input")
<ipython-input-19-16b473c8f9ae> in LifeClock()
4 def LifeClock():
5 bday = input("Please enter your date of birth(mm/dd/yyyy): ")
----> 6 m = re.findall("^\d{2}+\/+\d{2}+\/+\d{4}$", bday)
7 if m:
8 print (m)
/mnt/lovelace/software/anaconda/envs/py35/lib/python3.5/re.py in findall(pattern, string, flags)
211
212 Empty matches are included in the result."""
--> 213 return _compile(pattern, flags).findall(string)
214
215 def finditer(pattern, string, flags=0):
/mnt/lovelace/software/anaconda/envs/py35/lib/python3.5/re.py in _compile(pattern, flags)
291 if not sre_compile.isstring(pattern):
292 raise TypeError("first argument must be string or compiled pattern")
--> 293 p = sre_compile.compile(pattern, flags)
294 if not (flags & DEBUG):
295 if len(_cache) >= _MAXCACHE:
/mnt/lovelace/software/anaconda/envs/py35/lib/python3.5/sre_compile.py in compile(p, flags)
534 if isstring(p):
535 pattern = p
--> 536 p = sre_parse.parse(p, flags)
537 else:
538 pattern = None