Extraction of ssn no.,date,email address from a file in Python : 1.**My file contains below contents: rexp.txt**
`adf fdsf hh  h fg h 1995-11-23
dasvsbh 2000-04-12 gnym,mnbv 2001-02-17
dascvfbsn
bjhmndgfh
xgfdjnfhm244-44-2255  fgfdsg gfjhkh
fsgfdh 455-44-6577 dkjgjfkld
sgf
dgfdhj 
sdg 192.6.8.02 fdhdlk dfnfghr
fisdhfih dfhghihg 154.56.2.6 fdhusdgv
aff fjhgdf 
fdfdnfjgkpg
 fdf hgj  fdnbk gjdhgj 

dfdfg raeh95@gmail.com efhidhg  fdfuga reg@gmail.com
ergudfi rey@gmail.com iugftudfh dgufidjfdg
teeeee@gmail.comugfuhlfhs fgufif p`

2.I want to extract ssn number,date,email line by line.I'm expeccting codings which loops throughout every line and returns expected string 

3.***correct the coding in python***
`import re
def cfor_date(str):
    t=re.search(r'(\d{4}-\d{2}-\d{2})',str)
    return t
def cfor_ssn(str):
    f=re.search(r'(\d{3}-\d{2}-\d{4})',str)
    return f
def cfor_gm(str):
    g=re.search(r'([\w\.-]+@gmail[\w{3}\.-]+)',str)
    return g
f = open("rexp.txt","r").read()
lines = f.splitlines()
for line in iter(lines):
    x=line.split(" ")
    print x
    if (cfor_date(x)) != None: # i feel problem here
        r=cfor_ssn(x)
        print r`