摘要:驗證多行mail格式
驗證多行mail格式
<textarea rows="3" id="tcbcRtnErrEmail" cols="30" style="overflow-x:scroll;width:70%;height:140px;" class="form-control" data-ng-model="model.tcbcRtnErrEmail"></textarea >
var emails = $scope.model.tcbcRtnErrEmail.split(";");
var isFormat = true;
for(var i=0;i<emails.length;i++) {
var mail = '';
mail = emails[i];
if(!mail.match(/^(\w+)@([\w.]+)+$/))
isFormat = false;
}