<?php
//校驗(yàn)中文
^[\u4e00-\u9fa5]{0,}$
//由數(shù)字涧团,26個(gè)英文字母或下劃線組成的字符串
^\w+$
//校驗(yàn)E-Mail 地址
[\w!#$%&'+/=?^_{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_
{|}~-]+)@(?:\w?\.)+\w?
//校驗(yàn)身份證號碼
//15位:
^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$
//18位:
^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$
//校驗(yàn)日期
//“yyyy-mm-dd“ 格式的日期校驗(yàn)行疏,已考慮平閏年
^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$
//判斷IE的版本
^.MSIE 5-8?(?!.Trident\/[5-9]\.0).*$
//校驗(yàn)IP-v4地址
b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
//校驗(yàn)IP-v6地址
(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))
//檢查URL的前綴
if (!s.match(/^[a-zA-Z]+:\/\//)){
s = 'http://' + s;}
//文件路徑及擴(kuò)展名校驗(yàn)
([a-zA-Z]\:|\\)\\([\\]+\\)[^\/:?"<>|]+\.txt(l)?$;
//提取網(wǎng)頁圖片
\< [img][^\\>][src] *= [\"\']{0,1}([^\"\'\ >])
//提取頁面超鏈接
(<a\s(?!.\brel=)[^>])(href="https?:\/\/)((?!(?:(?:www\.)?'.implode('|(?:www\.)?', $follow_list).'))[^"]+)"((?!.\brel=)[>]*)(?:[>]*)>
匹配HTML標(biāo)簽
<\/?\w+((\s+\w+(\s=\s(?:".?"|'.?'|[\^'">\s]+))?)+\s|\s)\/?>
?>