<?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: JavaScript Password Validation</title>
	<atom:link href="http://blog.stevenlevithan.com/archives/javascript-password-validator/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stevenlevithan.com/archives/javascript-password-validator</link>
	<description>A JavaScript and regular expression centric blog</description>
	<lastBuildDate>Thu, 09 Feb 2012 10:18:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Emerik</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-password-validator/comment-page-1#comment-186930</link>
		<dc:creator>Emerik</dc:creator>
		<pubDate>Wed, 08 Feb 2012 09:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-password-validator#comment-186930</guid>
		<description>Solved it!

Instead of this:
	// enforce lower/upper/alpha/numeric/special rules
	for (rule in re) {
          if 
            ((pw.match(re[rule]) &#124;&#124; []).length &lt; o[rule])
			return false;
	}


I rewrote the code to this:

	// enforce lower/upper/alpha/numeric/special rules
	for (rule in re) {
          if 
            ((((pw.match(re[rule]) &#124;&#124; []).length &gt; 0) &amp;&amp; (o[rule] == -1)) &#124;&#124; 
            ((pw.match(re[rule]) &#124;&#124; []).length &lt; o[rule]))
			return false;
	}

And it worked!
Now, if I want to prohibit some characters, e.g. special characters, I just call the function with the option 

special: -1
And I can do the same for numeric, uppercase, lowercase and alpha</description>
		<content:encoded><![CDATA[<p>Solved it!</p>
<p>Instead of this:<br />
	// enforce lower/upper/alpha/numeric/special rules<br />
	for (rule in re) {<br />
          if<br />
            ((pw.match(re[rule]) || []).length &lt; o[rule])<br />
			return false;<br />
	}</p>
<p>I rewrote the code to this:</p>
<p>	// enforce lower/upper/alpha/numeric/special rules<br />
	for (rule in re) {<br />
          if<br />
            ((((pw.match(re[rule]) || []).length &gt; 0) &amp;&amp; (o[rule] == -1)) ||<br />
            ((pw.match(re[rule]) || []).length &lt; o[rule]))<br />
			return false;<br />
	}</p>
<p>And it worked!<br />
Now, if I want to prohibit some characters, e.g. special characters, I just call the function with the option </p>
<p>special: -1<br />
And I can do the same for numeric, uppercase, lowercase and alpha</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emerik</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-password-validator/comment-page-1#comment-186908</link>
		<dc:creator>Emerik</dc:creator>
		<pubDate>Wed, 08 Feb 2012 08:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-password-validator#comment-186908</guid>
		<description>Hi,
Great work! If you should modify the code to prohibit the use of special characters, numeric, etc... 

I think maybe, the code could be modified, so that default value of any option (i.e. when the rule does not apply) could be -1 and if numeric/special characters are not allowed at all, then the value is 0 (or vice-versa 0=default, -1=not allowed)</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Great work! If you should modify the code to prohibit the use of special characters, numeric, etc&#8230; </p>
<p>I think maybe, the code could be modified, so that default value of any option (i.e. when the rule does not apply) could be -1 and if numeric/special characters are not allowed at all, then the value is 0 (or vice-versa 0=default, -1=not allowed)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dnim</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-password-validator/comment-page-1#comment-179123</link>
		<dc:creator>dnim</dc:creator>
		<pubDate>Wed, 18 Jan 2012 08:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-password-validator#comment-179123</guid>
		<description>Thank you for nice work, Steven!</description>
		<content:encoded><![CDATA[<p>Thank you for nice work, Steven!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raju</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-password-validator/comment-page-1#comment-167635</link>
		<dc:creator>raju</dc:creator>
		<pubDate>Sat, 24 Dec 2011 10:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-password-validator#comment-167635</guid>
		<description>good</description>
		<content:encoded><![CDATA[<p>good</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DSLR-A900</title>
		<link>http://blog.stevenlevithan.com/archives/javascript-password-validator/comment-page-1#comment-155340</link>
		<dc:creator>DSLR-A900</dc:creator>
		<pubDate>Wed, 16 Nov 2011 17:00:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevenlevithan.com/archives/javascript-password-validator#comment-155340</guid>
		<description>Hanya pikir saya akan menjatuhkan Anda garis untuk memberitahu Anda situs Anda benar-benar batu! Saya telah mencari informasi semacam ini untuk waktu yang lama .. Saya biasanya tidak membalas posting tapi saya akan dalam kasus ini. WoW besar yang hebat.</description>
		<content:encoded><![CDATA[<p>Hanya pikir saya akan menjatuhkan Anda garis untuk memberitahu Anda situs Anda benar-benar batu! Saya telah mencari informasi semacam ini untuk waktu yang lama .. Saya biasanya tidak membalas posting tapi saya akan dalam kasus ini. WoW besar yang hebat.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

