Extract email and name with regex

后端 未结 5 2076
醉酒成梦
醉酒成梦 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:43

    (([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))
    

    https://regex101.com/r/pVV5TI/1

提交回复
热议问题