正则表达式是对字符串(包括普通字符(例如,a 到 z 之间的字母)和特殊字符(称为“元字符”))操作的一种逻辑公式,就是用事先定义好的一些特定字符及这些特定字符的组合,组成一个“规则字符串”,这个“规则字符串”用来表达对字符串的一种过滤逻辑。正则表达式是一种文本模式,该模式描述在搜索文本时要匹配的一个或多个字符串。
/^(?:(?:\+|00)86)?1\d{10}$/
/^(?:(?:\+|00)86)?1[3-9]\d{9}$/
/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/
/\d{3}-\d{8}|\d{4}-\d{7}/
/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
/[1-9]\d{5}(?!\d)/
/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/
/^[1-9]\d{9,29}$/
/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/
/^[1-9][0-9]{4,10}$/
/^[a-zA-Z][-_a-zA-Z0-9]{5,19}$/
/^\d+(?:\.\d+){2}$/
/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/
/^[a-zA-Z0-9_-]{4,16}$/
/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$/
/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&* ~()-+=]+$)(?![a-z0-9]+$)(?![a-z\\W_!@#$%^& *~()-+=]+$)(?![0-9\W_!@#$%^&* ~()-+=]+$)[a-zA-Z0-9\\W_!@#$%^&*~()-+=]/
/^(((ht|f)tps?):\/\/)?(^!@#$%^&*?.\s-?\.)+[a-z]{2,6}\/?/
/^((ht|f)tps?:\/\/)?[\w-]+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m,n}$/
/^[A-Za-z0-9]+$/
/^(?=.*[a-zA-Z])(?=.*\d).+$/
/^([a-f\d]{32}|[A-F\d]{32})$/
/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i
/^.{3,20}$/
/^[A-Za-z]+$/
/^[A-Z]+$/
/^[a-z]+$/
/^[\u4e00-\u9fa5]{0,}$/
/[\uFF00-\uFFFF]/
/[\u0000-\u00FF]/
/^[\u4E00-\u9FA5A-Za-z0-9_]+$/
/[^~\x22]+/
/(.)\1+/
/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/
/^(?:1[0-2]|0?[1-9]):[0-5]\d:[0-5]\d$/
/([0-1]?[0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$/
/^\d{4}-\d{1,2}-\d{1,2}/
/^\d{1,4}(-)(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31)$/
/^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))0229))$/
/^\d{4}([/:-\S])(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31) (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/
/^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
/^(0?[1-9]|1[0-2])$/
/^((0?[1-9])|((1|2)[0-9])|30|31)$/
/^(0?[13578]|1[02])$/
/(0[469]|11)-(0[1-9]|[12][0-9]|30)/
/^02-(0[1-9]|[1][0-9]|2[0-8])$/
/^(((19|20)([13579][26]|[2468][048]|0[48]))|(2000))$/
/^(((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-(0?[1-9]|[12]\d)$/
/((((19|20)\d{2})-(0?(1|[3-9])|1[012])-(0?[1-9]|[12]\d|30))|(((19|20)\d{2})-(0?[13578]|1[02])-31)|(((19|20)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-29))$/
/^((19|20)\d{2})$/
/^((((19|20)\d{2})-(0?[13-9]|1[012]))|(((19|20)\d{2})-(0?[13578]|1[02]))|(((19|20)\d{2})-0?2)|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2))$/
/^((((19|20)\d{2})-(0?[13-9]|1[012])-(0?[1-9]|[12]\d|30))|(((19|20)\d{2})-(0?[13578]|1[02])-31)|(((19|20)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-29))$/.test('2021-02-21')$/
/^(?:(?:1[6-9]|[2-9][0-9])[0-9]{2}([-/.]?)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:(?:1[6-9]|[2-9][0-9])(?:0[48]|[2468][048]|[13579][26])|(?:16|[2468][048]|[3579][26])00)([-/.]?)0?2\2(?:29))$/
/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$
/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/
/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i
/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i
/^((([a-f0-9]{2}:){5})|(([a-f0-9]{2}-){5}))[a-f0-9]{2}$/i
/^((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))$/
/^([a-zA-Z]\\:|\\\\)\\\\([^\\\\]+\\\\)*[^\\/:*?"<>|]+\\.txt(l)?$/
/^([a-zA-Z_]\w*)+([.][a-zA-Z_]\w*)+$/
/^([a-zA-Z]+-?)+[a-zA-Z0-9]+\\.[x|X][m|M][l|L]$/
//g
/<(\w+)[^>]*>(.*?<\/\1>)?/
/<(\S*?)[^>]*>.*?\1>|<.*? />/
/^\s*|\s*$/
/^\\s*[a-zA-Z\\-]+\\s*[:]{1}\\s[a-zA-Z0-9\\s.#]+[;]{1}/
/(]*)(href="https?:\\/\\/)((?!(?:(?:www\\.)?'.implode('|(?:www\\.)?', $follow_list).'))[^" rel="external nofollow" ]+)"((?!.*\\brel=)[^>]*)(?:[^>]*)>/
/\\< *[img][^\\\\>]*[src] *= *[\\"\\']{0,1}([^\\"\\'\\ >]*)/
/^thunder:\/\/[a-zA-Z0-9]+=$/
/^ed2k:\/\/|file|.+|\/$/
/^\/(\w+\/)+\w+\.\w+$/
/^[a-zA-Z]:\\(?:\w+\\)*\w+\.\w+$/
/^-?\d+(,\d{3})*(\.\d{1,2})?$/
/(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{2}$)/
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
/(^[EeKkGgDdSsPpHh]\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\d{7}$)/
/^[a-zA-Z]\d{6}\([\dA]\)$/
/^[1|5|7]\d{6}\(\d\)$/
/^[a-zA-Z][0-9]{9}$/
/^(s[hz]|S[HZ])(000[\d]{3}|002[\d]{3}|300[\d]{3}|600[\d]{3}|60[\d]{4})$/
/\b((?!abc)\w)+\b/