正则表达式之应用识别器

我们就什么也不说了,上

<?xml version="1.0" encoding="UTF-8" ?>
<ONEKEYSEARCH>
	<APPTYPEDETECTOR>
		<!-- 15,17关键词 见conf配置文件 -->
		<!-- 15位身份证 -->
		<REGEXAPPTYPE apptype="1" regex="([1-9][0-9]{5})(([0-9]{2})((0[1-9])|(1[0-2]))((0[1-9])|(1[0-9])|(2[0-9])|(3[01])))([0-9]{3})"/>
		<!-- 18位身份证 -->
		<REGEXAPPTYPE apptype="1" regex="([1-9][0-9]{5})([1-9][0-9]{3})((0[1-9])|(1[0-2]))((0[1-9])|(1[0-9])|(2[0-9])|(3[01]))([0-9]{3})([0-9Xx])"/>
		<!-- 中文姓名 普遍在6个字(85.6) 最长15  -->
		<REGEXAPPTYPE apptype="2" regex="[\u4e00-\u9fa5]([\s]?[\u4e00-\u9fa5]){1,5}"/>
		<!-- 手机号码 -->
			<!-- 移动 -->
			<REGEXAPPTYPE apptype="3" regex="^1(3[4-9]|5[012789]|8[78])\d{8}$"/>   
			<!-- 联通 -->
			<REGEXAPPTYPE apptype="3" regex="^1(3[0-2]|5[56]|8[56])\d{8}$"/>
			<!-- 电信 -->
			<REGEXAPPTYPE apptype="3" regex="^18[09]\d{8}$"/>
			<!-- CDMA -->
			<REGEXAPPTYPE apptype="3" regex="^1[35]3\d{8}$"/> 
		<!-- <REGEXAPPTYPE apptype="3" regex="^1((3[4-9]|5[012789]|8[78])|(3[0-2]|5[56]|8[56])|(8[09])|([35]3))\d{8}$"/>-->
			
		<!-- 家庭电话 -->
		<REGEXAPPTYPE apptype="3" regex="(\(?(\+|(00))?[1-9][0-9]{1,2}\)?)?(\(?0[1-9][0-9]{1,2}\)?-?)?([1-9][0-9]{6,7})"/>
		<!-- 办公电话 -->
		<REGEXAPPTYPE apptype="3" regex="(\(?(\+|(00))[1-9][0-9]{1,2}\)?)?(\(?0[1-9][0-9]{1,2}\)?-?)?([1-9][0-9]{6,7})(-[0-9]{2,4})?"/>
		<!-- 地址 -->
		<!-- <REGEXAPPTYPE apptype="4" regex="[\u4e00-\u9fa5]([\s]*[0-9a-zA-Z\u4e00-\u9fa5]){1,27}"/> -->
		<!-- 企业名称  公司|厂|交易所|基业|伟业|产业|中心|城|场|店|堂-->
		<REGEXAPPTYPE apptype="5" regex="[0-9a-zA-Z\u4e00-\u9fa5]{2,28}(\u516C\u53F8|\u5382|\u4EA4\u6613\u6240|\u57FA\u4E1A|\u4EA7\u4E1A|\u4F1F\u4E1A|\u4E2D\u5FC3|\u57CE|\u5E97|\u573A|\u5802)"/>
		<!-- ADSL账号 -->
		<REGEXAPPTYPE apptype="6" regex="([a-zA-Z][0-9a-zA-Z]{1,23})[@](([0-9a-zA-Z]{1,24})\.)?[a-zA-Z]{2,}"/>
		<REGEXAPPTYPE apptype="6" regex="[a-zA-Z][0-9a-zA-Z]{1,23}"/>
		<!-- QQ账号 -->
		<REGEXAPPTYPE apptype="7" regex="[1-9][0-9]{4,9}"/>
	    <REGEXAPPTYPE apptype="7" regex="1(([35]3)|(8[09]))[0-9]{8}"/>
		<!-- IP地址 IPv4 IPv6 -->
		<REGEXAPPTYPE apptype="8" regex="(([0-9a-fA-F]{4}:){6})?(((25[0-5])|(2[0-4][0-9])|([01]?[0-9]{1,2}))([.])){3}((25[0-5])|(2[0-4][0-9])|([01]?[0-9]{1,2}))"/>
		<REGEXAPPTYPE apptype="8" regex="([0-9a-fA-F]{4}:){7}([0-9a-fA-F]{4})"/>
		<!-- MAC地址 -->
		<REGEXAPPTYPE apptype="9" regex="((([0-9abcdefABCDEF]){2})([-:.])){5}(([0-9abcdefABCDEF]){2})"/>
		<!-- MAIL账号 -->
		<REGEXAPPTYPE apptype="10" regex="([a-zA-Z_][0-9a-zA-Z_.]{1,23})[@#]([0-9a-zA-Z]{1,6}\.)?([0-9a-zA-Z]{1,24})(\.(com|edu|gov|int|mil|net|org|COM|EDU|GOV|INT|MIL|NET|ORG))?\.((com|edu|gov|int|mil|net|org|COM|EDU|GOV|INT|MIL|NET|ORG)|(cn|tw|uk|jp|de|CN|TW|UK|JP|DE))"/>
		<REGEXAPPTYPE apptype="10" regex="^[1-9][0-9]{3,10}@([0-9a-zA-Z]{1,6}\.)?qq\.com$"/>
		<!-- 密码 -->
	<!--	<REGEXAPPTYPE apptype="11" regex="^[^\s]{1,20}$"/> -->
		<!-- 用户名 -->
		<REGEXAPPTYPE apptype="13" regex="[0-9a-zA-Z_.@\u4e00-\u9fa5]([\s]*[0-9a-zA-Z_.@\u4e00-\u9fa5]){1,19}" />
		<!-- 网站论坛 匹配0-12的前缀+BBS|论坛|社区|贴吧|讨论区|八卦|娱乐|贴图|在线 -->
		<REGEXAPPTYPE apptype="14" regex="[0-9a-zA-Z\u4e00-\u9fa5]{0,12}(BBS|\u8BBA\u575B|\u793E\u533A|\u8D34\u5427|\u8BA8\u8BBA\u533A|\u516B\u5366|\u5A31\u4E50|\u8D34\u56FE|\u5728\u7EBF)"/>
		<!-- 银行账号 目前支持62开头的银联卡13,16,19-->
		<REGEXAPPTYPE apptype="16" regex="62([0-9]{11}|[0-9]{14}|[0-9]{17})"/>
		<!-- 18 IM  -->
		<!-- QQ 群号  -->
		<REGEXAPPTYPE apptype="19" regex="([1-9][0-9]{5,8})" />
		<!-- 时间 -->
		<!-- YYYY-MM-DD 识别闰年 2月等-->
		<REGEXAPPTYPE apptype="20" regex="^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$" />
		<!-- YYYY-MM-DD HH:mm:ss -->
	<!-- <REGEXAPPTYPE apptype="20" regex="" /> -->	
		<!-- YYYY/MM/DD -->
	<!-- <REGEXAPPTYPE apptype="20" regex="" /> -->	
		<!-- YYYY.MM.DD -->
	<!-- <REGEXAPPTYPE apptype="20" regex="" /> -->	
		<!-- 网吧名称  匹配0-22的前缀+网络|网吧 -->
		<REGEXAPPTYPE apptype="21" regex="[0-9a-zA-Z\u4e00-\u9fa5]{0,22}(\u7F51\u5427|\u7F51\u7EDC)" />
	</APPTYPEDETECTOR>
</ONEKEYSEARCH>

posted @ 2011-05-09 20:32  明将军  Views(542)  Comments(0Edit  收藏  举报
恨怨悲苦憎怒嗔、仁爱慈孝耻义廉。是故恨人所以得仁,无爱者必不怨,不慈者必无悲,孝而有苦,憎后耻来,义自怒生,廉人心嗔。夹天地七大苦,破人情七大碍,遂舍善恶之心,得称剑神。