﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-wayne's space-文章分类-Regular Expression</title><link>http://www.blogjava.net/waynedou/category/50284.html</link><description>Novice's Attitude</description><language>zh-cn</language><lastBuildDate>Sun, 04 Dec 2011 14:37:48 GMT</lastBuildDate><pubDate>Sun, 04 Dec 2011 14:37:48 GMT</pubDate><ttl>60</ttl><item><title>Regular Expression基础</title><link>http://www.blogjava.net/waynedou/articles/365516.html</link><dc:creator>wayne woo</dc:creator><author>wayne woo</author><pubDate>Sun, 04 Dec 2011 12:55:00 GMT</pubDate><guid>http://www.blogjava.net/waynedou/articles/365516.html</guid><wfw:comment>http://www.blogjava.net/waynedou/comments/365516.html</wfw:comment><comments>http://www.blogjava.net/waynedou/articles/365516.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/waynedou/comments/commentRss/365516.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/waynedou/services/trackbacks/365516.html</trackback:ping><description><![CDATA[字符：<br />. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 任意字符，可以为字母，数字，空白等。<br />\w &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;字符(a-zA-Z)，数字(0-9)，下划线。<br />\W &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 非字母数字。。。与\w相反。<br />\d &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;数字。<br />\D &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 非数字。<br />\s &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;空格，Tab，回车，换行。<br />\S &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;与\s相反。<br />^ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 正则字符串的开始标记。<br />$ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.................结尾标记。<br />\b &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;空格符，用来判断串，非字符，非数字，或一些字符的开始或结尾。<br />[] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 取[]符号对中的任意一个，注意是一个。例如：[a-z]即一个小写字母。<br />[^] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 同样也是取一个但是，规则和[]相反。例如：[^a-z]即一个非小写字母。<br />| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;或者符号。例如： a|b 则匹配a或者b中的一个。<br />\ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;讲下一个字符标记为一个特殊字符、或一个原义字符、或一个向后引用、或一个八进制转义符。例如，'n'匹配字符"n"。 '\n'匹配一个换行符。序列 '\\' 匹配 "\" 而<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"\("则匹配 "("。<br /><div>更多参考：<a href="http://www.cnblogs.com/yirlin/archive/2006/04/12/373222.html">http://www.cnblogs.com/yirlin/archive/2006/04/12/373222.html</a>(感谢)<br /><br />有用的正则：<br /><br />邮件验证：/^[\w!#$%&amp;\&#8217;*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/i<br />最后的/i是为了说明大小写不敏感的。<br /><br />日期：([01]?\d)[-\/ .]([0123]?\d)[-\/ .](\d{4})<br /><br />Web地址：((\bhttps?:\/\/)|(\bwww\.))\S*</div><img src ="http://www.blogjava.net/waynedou/aggbug/365516.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/waynedou/" target="_blank">wayne woo</a> 2011-12-04 20:55 <a href="http://www.blogjava.net/waynedou/articles/365516.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>