Validate a comma separated email list

前端 未结 5 1111
北恋
北恋 2021-01-04 11:00

I\'m trying to come up with a regular expression to validate a comma separated email list.

I would like to validate the complete list in the first place, then split

5条回答
  •  清歌不尽
    2021-01-04 11:35

    I am using the Regex from many years and code is same. I believe this works for every one:

    ^(\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]{2,4}\s*?,?\s*?)+$
    

    Be happy :)

提交回复
热议问题