<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>看!corey,那天比你高多拉~~~ - regexp</title><link>http://blog.csdn.net/turkeyzhou/category/368878.aspx</link><description /><dc:language>zh-CN</dc:language><lastUpdateTime>Tue, 22 Apr 2008 23:12:06 GMT</lastUpdateTime><ttl>60</ttl><item><dc:creator>corey</dc:creator><title>常用的匹配正则表达式和实例</title><link>http://blog.csdn.net/turkeyzhou/archive/2008/03/16/2186739.aspx</link><pubDate>Sun, 16 Mar 2008 01:57:00 GMT</pubDate><guid>http://blog.csdn.net/turkeyzhou/archive/2008/03/16/2186739.aspx</guid><wfw:comment>http://blog.csdn.net/turkeyzhou/comments/2186739.aspx</wfw:comment><comments>http://blog.csdn.net/turkeyzhou/archive/2008/03/16/2186739.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/turkeyzhou/comments/commentRss/2186739.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2186739</trackback:ping><description>匹配网址URL的正则表达式：http://([\w-] \.) [\w-] (/[\w- ./?%&amp;amp;=]*)? 利用正则表达式去除字串中重复的字符的算法程序： var s="abacabefgeeii" var s1=s.replace(/(.).*\1/g,"$1") var re=new RegExp("[" s1 "]","g") var s2=s.replace(re,"") alert(s1 s2) //结果为：abcefgi 这是表达式实现去除重复字符的方法最简单的实现方法。 思路是使用后向引用取出包括重复的字符，再以重复的字符建立第二个表达式，取到不重复的字符，两者串连。这个方法对于字符顺序有要求的字符串可能不适用。 得用正则表达式从URL地址中提取文件名的javascript程序，如下结果为page1 s="http://www.9499.net/page1.htm" s=s.replace(/(.*\/){0,}([^\.] ).*/ig,"$2") alert(s) 利用正则表达式限制网页表单里的文本框输入内容： &lt;img src ="http://blog.csdn.net/turkeyzhou/aggbug/2186739.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>