How to match a comma separated list of emails with regex?

前端 未结 13 1209
一整个雨季
一整个雨季 2020-12-15 07:29

Trying to validate a comma-separated email list in the textbox with asp:RegularExpressionValidator, see below:



        
13条回答
  •  囚心锁ツ
    2020-12-15 07:58

    ^([\w+-.%]+@[\w-.]+\.[A-Za-z]+)(, ?[\w+-.%]+@[\w-.]+\.[A-Za-z]+)*$
    

    Works correctly with 0 or 1 spaces after each comma and also for long domain extensions

提交回复
热议问题