<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 正则表达式匹配ABCD随机字串</title>
	<atom:link href="http://iregex.org/blog/regex-against-abcd.html/feed" rel="self" type="application/rss+xml" />
	<link>http://iregex.org/blog/regex-against-abcd.html</link>
	<description>关注正则表达式和搜索引擎</description>
	<lastBuildDate>Mon, 22 Feb 2010 14:55:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: DemoJameson</title>
		<link>http://iregex.org/blog/regex-against-abcd.html/comment-page-1#comment-2713</link>
		<dc:creator>DemoJameson</dc:creator>
		<pubDate>Mon, 08 Feb 2010 15:38:03 +0000</pubDate>
		<guid isPermaLink="false">http://iregex.org/?p=37#comment-2713</guid>
		<description>第二个正则不符合要求，它只能确保前两个字母，以下字母也会被匹配：
abad、abcb……</description>
		<content:encoded><![CDATA[<p>第二个正则不符合要求，它只能确保前两个字母，以下字母也会被匹配：<br />
abad、abcb……</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bonny</title>
		<link>http://iregex.org/blog/regex-against-abcd.html/comment-page-1#comment-1819</link>
		<dc:creator>bonny</dc:creator>
		<pubDate>Sat, 14 Nov 2009 09:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://iregex.org/?p=37#comment-1819</guid>
		<description>如果不是a-d，而是a-z最好用两个正则：

var reg1 = /[a-d]{4}/g;
var reg2 = /^(?!([a-d])\1)[a-d]{4}$/;

function findout(s, callback) {
var arr = s.match(reg1);
for(var i=0,len=arr.length;i&lt;len;i++){
if(reg2.test(arr[i]))
callback(arr[i]);
}
}

findout(&#039;aabc abcd acbd adbc aecfegba cadb aebcd&#039;, function(s){
alert(s);
});
</description>
		<content:encoded><![CDATA[<p>如果不是a-d，而是a-z最好用两个正则：</p>
<p>var reg1 = /[a-d]{4}/g;<br />
var reg2 = /^(?!([a-d])\1)[a-d]{4}$/;</p>
<p>function findout(s, callback) {<br />
var arr = s.match(reg1);<br />
for(var i=0,len=arr.length;i&lt;len;i++){<br />
if(reg2.test(arr[i]))<br />
callback(arr[i]);<br />
}<br />
}</p>
<p>findout(&#039;aabc abcd acbd adbc aecfegba cadb aebcd&#039;, function(s){<br />
alert(s);<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zhasm</title>
		<link>http://iregex.org/blog/regex-against-abcd.html/comment-page-#comment-269</link>
		<dc:creator>zhasm</dc:creator>
		<pubDate>Sat, 20 Dec 2008 03:50:14 +0000</pubDate>
		<guid isPermaLink="false">http://iregex.org/?p=37#comment-269</guid>
		<description>不错不错，测试通过。比我的正则式要写得简洁、美观。</description>
		<content:encoded><![CDATA[<p>不错不错，测试通过。比我的正则式要写得简洁、美观。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 那个谁</title>
		<link>http://iregex.org/blog/regex-against-abcd.html/comment-page-1#comment-268</link>
		<dc:creator>那个谁</dc:creator>
		<pubDate>Sat, 20 Dec 2008 03:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://iregex.org/?p=37#comment-268</guid>
		<description>我的:
(?=.{0,3}a)(?=.{0,3}b)(?=.{0,3}c)(?=.{0,3}d).{4}

inspired by &lt;a href=&quot;http://is.gd/cD8x&quot; target=&quot;_blank&quot;&gt;http://is.gd/cD8x&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>我的:<br />
(?=.{0,3}a)(?=.{0,3}b)(?=.{0,3}c)(?=.{0,3}d).{4}</p>
<p>inspired by <a href="http://is.gd/cD8x" target="_blank">http://is.gd/cD8x</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
