Extract email addresses from a text file using JavaScript

后端 未结 7 543
没有蜡笔的小新
没有蜡笔的小新 2020-12-11 09:42

I have more than 2000 email addresses. which i have exported from feedburner. And the email address look like below;

    adminvicky@gmail.com   Active  12/05         


        
相关标签:
7条回答
  • 2020-12-11 10:27

    Try to use this regex:

    ([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)
    

    REGEX DEMO

    In your Javascript you can implement it like this:

    function getMail ( text ){
        return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);
        }
    

    JSFIDDLE DEMO

    0 讨论(0)
提交回复
热议问题