﻿<?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-道生一,一生二,二生三,三生万物-随笔分类-JavaScript</title><link>http://www.blogjava.net/doodoosun/category/25585.html</link><description>万物皆备于我</description><language>zh-cn</language><lastBuildDate>Tue, 04 Sep 2007 18:01:10 GMT</lastBuildDate><pubDate>Tue, 04 Sep 2007 18:01:10 GMT</pubDate><ttl>60</ttl><item><title>JavaScript 的正则表达式和例子</title><link>http://www.blogjava.net/doodoosun/archive/2007/08/10/135840.html</link><dc:creator>doodoosun</dc:creator><author>doodoosun</author><pubDate>Fri, 10 Aug 2007 07:03:00 GMT</pubDate><guid>http://www.blogjava.net/doodoosun/archive/2007/08/10/135840.html</guid><wfw:comment>http://www.blogjava.net/doodoosun/comments/135840.html</wfw:comment><comments>http://www.blogjava.net/doodoosun/archive/2007/08/10/135840.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/doodoosun/comments/commentRss/135840.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/doodoosun/services/trackbacks/135840.html</trackback:ping><description><![CDATA[<p>在Java 的API中有一个舍去前后空白字符串的方法trim()<br><br>我们在JavaScript 中找不到该方法，我们可以写一个函数来实现去掉字符串的前后空白。<br><br>这个函数是：<br><br><span style="COLOR: #ff0000"><br><strong>String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }</strong></span></p>
<p><span>function ppp(){<br>var a="&nbsp;&nbsp;&nbsp;&nbsp; 888&nbsp;&nbsp;&nbsp;&nbsp; ";<br>alert(a.Trim());<br>}<br><br>这个例子中去掉了888 前后的空白<br><br>下面对这个例子进行更详细解释：<br><br>首先： replace(&nbsp; ,"")函数就是用后面的空字符串，在替换前面所指定的字符<br><strong><font style="FONT-SIZE: 18pt" color=#ff0000>/(^\s*)|(\s*$)/g, ""<br></font></strong><br><br>/是正则表达式匹配的语法：<br><br>正则表达式对象说明<br>语法1：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var regularexpression=/pattern/[switch]<br><br>&nbsp;语法&nbsp;&nbsp;2 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; var &nbsp; regularexpression &nbsp; = &nbsp; new &nbsp; RegExp("pattern",["switch"])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br><br>&nbsp; 正则表达式对象语法参数有以下部分： &nbsp; &nbsp; <br>&nbsp; ___________________________________________________________________ &nbsp; <br>&nbsp; 参数部分 &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 描述 &nbsp; &nbsp; <br>&nbsp; ------------------------------------------------------------------- &nbsp; <br>&nbsp; pattern &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp; 必需的。要使用的正则表达式模式，例如使用替换方法replace &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; | &nbsp; 时，就是要替换的文本。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp; 语法 &nbsp; 1，用 &nbsp; "/" &nbsp; 字符分隔模式。&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; 语法 &nbsp;&nbsp;&nbsp;&nbsp; 2，用引号将模式引起来。 &nbsp; &nbsp; <br>&nbsp; ------------------------------------------------------------------- &nbsp; <br>&nbsp; switch &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; | &nbsp; 可选项。语法&nbsp;&nbsp;2 &nbsp; 要用引号将 &nbsp; switch &nbsp; 引起来。可选的开 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 关选项有： &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; i &nbsp; （忽略大小写） &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;<span style="COLOR: #ff0000"> g</span> &nbsp; （全文查找出现的所有 &nbsp; pattern） &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; gi &nbsp; （全文查找、忽略大小写） &nbsp; <br>&nbsp; -------------------------------------------------------------------&nbsp;&nbsp;&nbsp;<br><br><br>&nbsp; 语法1 当预先知道查找字符串时用<br>&nbsp; 语法&nbsp;2 当查找字符串经常变动或不知道时用，比如由用户输入得到的字符串。&nbsp;&nbsp; <br><br>在使用前 &nbsp; pattern &nbsp; 参数被编译为内部格式。<br>对语法 &nbsp; 1 &nbsp; 来说，pattern &nbsp; 在该脚本被装载时被编译。<br>对语法 &nbsp; 2 &nbsp; 来说，pattern &nbsp; 在使用前，或调用 &nbsp; compile &nbsp; 方法时被编译。&nbsp;&nbsp; <br><br><br><br>正则表达式的语法表：<br><br>字符 &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 描述 &nbsp; &nbsp; <br>&nbsp; ---------------------------------------------------------------- &nbsp; <br>&nbsp; \ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 标记下一个字符是特殊字符或文字。例如，"n" &nbsp; 和字符 &nbsp; "n" &nbsp; 匹配。 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; "\n" &nbsp; 则和换行字符匹配。序列 &nbsp; "\\" &nbsp; 和 &nbsp; "\" &nbsp; 匹配，而 &nbsp; "\(" &nbsp; 则 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 和 &nbsp; "(" &nbsp; 匹配。 &nbsp; &nbsp; <br>&nbsp; ---------------------------------------------------------------- &nbsp; <br><span style="COLOR: #ff0000">&nbsp; ^</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 匹配输入的开头。 &nbsp; &nbsp; <br>&nbsp; ---------------------------------------------------------------- &nbsp; <br><span style="COLOR: #ff0000">&nbsp; $</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 匹配输入的末尾。 &nbsp; &nbsp; <br>&nbsp; ---------------------------------------------------------------- &nbsp; <br><span style="COLOR: #ff0000">&nbsp; *</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp;<span style="COLOR: #ff0000"> 匹配前面的子表达式零或多次</span>。例如，"zo*" &nbsp; 与 &nbsp; "z" &nbsp; 或 &nbsp; "zoo" &nbsp; 匹配。等价于&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {0，} &nbsp; &nbsp; <br>&nbsp; ---------------------------------------------------------------- &nbsp; <br>&nbsp; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 匹配前面的子表达式一次或多次。例如，"zo+" &nbsp; 与 &nbsp; "zoo" &nbsp; 匹配，但和 &nbsp; "z" &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; 不匹配。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ---------------------------------------------------------------- &nbsp; <br>&nbsp; ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 匹配前一个字符零或一次。例如，"a?ve?" &nbsp; 和 &nbsp; "never" &nbsp; 中的 &nbsp; "ve" &nbsp; 匹 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 配。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; . &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配除换行字符外的任何单个字符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; (pat- &nbsp; | &nbsp; &nbsp; 匹配 &nbsp; pattern &nbsp; 并记住该匹配。匹配上的子字符串，可以使用 &nbsp; Item &nbsp; &nbsp; <br>&nbsp; tern) &nbsp; | &nbsp; &nbsp; [0]...[n]，来从生成的 &nbsp; Matches &nbsp; 集合中取回。要匹配圆括号字 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 符 &nbsp; ( &nbsp; )，则需使用 &nbsp; "\(" &nbsp; 或 &nbsp; "\)"。 &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br><span style="COLOR: #ff0000">&nbsp; x|y</span> &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 匹配 &nbsp; x &nbsp; 或 &nbsp; y。例如，"z|food" &nbsp; 和 &nbsp; "z" &nbsp; 或 &nbsp; "food" &nbsp; 匹配。"(z|f) &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; ood" &nbsp; 匹配 &nbsp; "zoo" &nbsp; 或 &nbsp; "food"。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; {n} &nbsp; &nbsp; &nbsp; | &nbsp; n &nbsp; 是非负整数。共匹配 &nbsp; n &nbsp; 次。例如，"o{2}" &nbsp; 和 &nbsp; "Bob" &nbsp; 中的 &nbsp; "o" &nbsp; 不匹 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 配，但和 &nbsp; "foooood" &nbsp; 中的前两个 &nbsp; o &nbsp; 匹配。 &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; {n,} &nbsp; &nbsp; | &nbsp; n &nbsp; 是一个非负整数。至少匹配 &nbsp; n &nbsp; 次。例如，"o{2,}" &nbsp; 和 &nbsp; "Bob" &nbsp; 中 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 的 &nbsp; "o" &nbsp; 不匹配，但和 &nbsp; "foooood" &nbsp; 中的所有 &nbsp; o &nbsp; 匹配。"o{1,}" &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 与 &nbsp; "o+" &nbsp; 等效。"o{0,}" &nbsp; 和 &nbsp; "o*" &nbsp; 等效。 &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; {n,m} &nbsp; | &nbsp; m &nbsp; 和 &nbsp; n &nbsp; 是非负整数。至少匹配 &nbsp; n &nbsp; 次而至多匹配 &nbsp; m &nbsp; 次。例如，"o &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; {1,3}" &nbsp; 和 &nbsp; "fooooood" &nbsp; 中的前三个 &nbsp; o &nbsp; 匹配。"o{0,1}" &nbsp; 和 &nbsp; "o?" &nbsp; 等 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 效。 &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; [xyz] &nbsp; | &nbsp; 字符集合。匹配括号内的任一字符。例如，"[abc]" &nbsp; 和 &nbsp; "plain" &nbsp; 中 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 的 &nbsp; "a" &nbsp; 匹配。 &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; [^xyz]| &nbsp; 否定字符集合。匹配非括号内的任何字符。例如，"[^abc]" &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; 和 &nbsp; "plain" &nbsp; 中的 &nbsp; "p" &nbsp; 匹配。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; [a-z] &nbsp; | &nbsp; 字符范围。和指定范围内的任一字符匹配。例如，"[a-z]" &nbsp; 匹配 &nbsp; "a" &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 到 &nbsp; "z"范围内的任一小写的<nobr oncontextmenu="return false;" onmousemove=kwM(2); id=key2 onmouseover="kwE(event,2, this);" style="COLOR: #6600ff; BORDER-BOTTOM: 0px dotted; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout="kwL(event, this);" target="_blank">字母</nobr>表字符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; [^m-z]| &nbsp; 否定字符范围。匹配不在指定范围内的任何字符。例如，"[m-z]" &nbsp; 匹配不 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 在 &nbsp; "m" &nbsp; 到 &nbsp; "z"范围内的任何字符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \b &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配字的<nobr oncontextmenu="return false;" onmousemove=kwM(4); id=key4 onmouseover="kwE(event,4, this);" style="COLOR: #6600ff; BORDER-BOTTOM: 0px dotted; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout="kwL(event, this);" target="_blank">边界</nobr>，也就是说，在字和空格之间的位置。例如，"er\b" &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 和 &nbsp; "never" &nbsp; 中的 &nbsp; "er" &nbsp; 匹配，但和 &nbsp; "verb" &nbsp; 中的 &nbsp; "er" &nbsp; 不匹配。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \B &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配非字边界。"ea*r\B" &nbsp; 和 &nbsp; "never &nbsp; early" &nbsp; 中的 &nbsp; "ear" &nbsp; 匹配。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \d &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配数字字符。等价于 &nbsp; [0-9]。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \D &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配非数字字符。等价于 &nbsp; [^0-9]。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \f &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配换页字符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \n &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配换行字符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \r &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配回车符字符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br><span style="COLOR: #ff0000">&nbsp; \s</span> &nbsp; &nbsp; &nbsp; &nbsp; |匹配任何空白，包括空格、制表、换页等。与 &nbsp; "[ &nbsp; \f\n\r\t\v]" &nbsp; 等效。 &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \S &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配任何非空白字符。与 &nbsp; "[^ &nbsp; \f\n\r\t\v]" &nbsp; 等效。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \t &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配制表字符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \v &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配垂直制表符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \w &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配包括下划线在内的任何字字符。与 &nbsp; "[A-Za-z0-9_]" &nbsp; 等效。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \W &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配任何非字字符。与 &nbsp; "[^A-Za-z0-9_]" &nbsp; 等效。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \num &nbsp; &nbsp; | &nbsp; 匹配 &nbsp; num，其中 &nbsp; num &nbsp; 是一个正整数。返回记住的匹配的引用。例 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 如，"(.)\1" &nbsp; 匹配两个连续的同一字符。 &nbsp; &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \n &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 匹配 &nbsp; n，其中 &nbsp; n &nbsp; 是八进制换码值。八进制换码值必须是 &nbsp; 1、2、或 &nbsp; 3 &nbsp; 位 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 长。例如，"\11" &nbsp; 和 &nbsp; "\011" &nbsp; 都匹配制表字符。"\0011" &nbsp; 和 &nbsp; "\001" &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &amp; &nbsp; "1" &nbsp; 是等效的。八进制换码值必须不超过 &nbsp; 256。如果超过了，则只有 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 前两位组成表达式。允许在正则表达式中使用 &nbsp; ASCII &nbsp; 码。 &nbsp; &nbsp; <br>&nbsp; ----------------------------------------------------------------- &nbsp; <br>&nbsp; \xn &nbsp; &nbsp; &nbsp; | &nbsp; 匹配 &nbsp; n，其中 &nbsp; n &nbsp; 是十六进制换码值。十六进制换码值必须正好是两位 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 长。例如，"\x41" &nbsp; 与 &nbsp; "A" &nbsp; 匹配。"\x041" &nbsp; 和 &nbsp; "\x04" &nbsp; &amp; &nbsp; "1" &nbsp; 是等效 &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 的。允许在正则表达式中使用 &nbsp; ASCII &nbsp; 码。 &nbsp; &nbsp; <br>&nbsp; -----------------------------------------------------------------&nbsp;&nbsp; <br><br><br><br><br><br><br><br></span><br><br><br><br><br></p>
 <img src ="http://www.blogjava.net/doodoosun/aggbug/135840.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/doodoosun/" target="_blank">doodoosun</a> 2007-08-10 15:03 <a href="http://www.blogjava.net/doodoosun/archive/2007/08/10/135840.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>