Angular电子邮件REGEX是:
/ ^ [A-Z0-9#$%&安培;'!? + / = ^ _`{|}〜.-] + @一个-Z0-9(A-β。 Z0-9?) $ / I
我理解一切,但我不确定我最后的意思是什么。
它是唯一拥有它的REGEX:
var ISO_DATE_REGEXP = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;
var DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})$/;
var DATETIMELOCAL_REGEXP = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
var WEEK_REGEXP = /^(\d{4})-W(\d\d)$/;
var MONTH_REGEXP = /^(\d{4})-(\d\d)$/;
var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
答案 0 :(得分:2)
它是不区分大小写的标志:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
答案 1 :(得分:1)
i修饰符用于执行不区分大小写的匹配。
答案 2 :(得分:1)
i表示不区分大小写。有关详细信息,请参阅此处:matchsearchhttps://www.w3schools.com/jsref/jsref_regexp_i.asp
答案 3 :(得分:0)
ignore case
或case-insensitive
匹配标志。
A
和a
意味着同样的事情。
var regex = /pattern/flags;
。以下是用于高级搜索的标志。