Extract email sub-strings from large document

前端 未结 11 2204
星月不相逢
星月不相逢 2020-11-28 06:54

I have a very large .txt file with hundreds of thousands of email addresses scattered throughout. They all take the format:

......
         


        
11条回答
  •  难免孤独
    2020-11-28 07:17

    import re 
    txt = 'hello from absc@gmail.com to par1@yahoo.com about the meeting @2PM'
    email  =re.findall('\S+@\S+',s)
    print(email)
    

    Printed output:

    ['absc@gmail.com', 'par1@yahoo.com']
    

提交回复
热议问题