Extract email and name with regex

后端 未结 5 2077
醉酒成梦
醉酒成梦 2020-12-06 02:10

What would be the regular expressions to extract the name and email from strings like these?

johndoe@example.com
John 
John Doe &l         


        
5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 02:22

    This way you can get with or without name, removing the quotes.

    \"*?(([\p{L}0-9-_ ]+)\"?)*?\b\ *?
    

提交回复
热议问题