Regular Expression for delimited email address

后端 未结 6 471
不知归路
不知归路 2021-01-17 09:20

i am looking for a regular express to validate a list of email addresses like the following

test1@abd.com;test.test@abc.com;test3@test.com

and

6条回答
  •  Happy的楠姐
    2021-01-17 10:18

    I needed to allow for the presence of white space around the delimiter, so I used this modification of Evan Mulawski's answer:

    ^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+(\s*[;.]\s*(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$

    Test it at: http://regexlib.com/RETester.aspx?regexp_id=13126

提交回复
热议问题