<?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: How to validate date using Java regular expression</title>
	<atom:link href="http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/</link>
	<description>Effective programming and blogging tips by Zaheer Paracha</description>
	<lastBuildDate>Sat, 11 Feb 2012 03:00:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: dean</title>
		<link>http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/comment-page-1/#comment-1919</link>
		<dc:creator>dean</dc:creator>
		<pubDate>Fri, 20 Jan 2012 19:04:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/?p=797#comment-1919</guid>
		<description>Just put the limitation as:

function validate_date(date)
	{
		var pattern= new RegExp(&quot;^(0[1-9]&#124;1[012])[/]?(0[1-9]&#124;[12][0-9]&#124;3[01])[/]?(2012)\$&quot;);
		return pattern.test(date);
	}

if(!validate_date(data_date)){
			alert(&#039;Invalid Date. Correct format is dd/mm/yyyy&#039;);
			return false;
		}


so, user may type / symbol only..</description>
		<content:encoded><![CDATA[<p>Just put the limitation as:</p>
<p>function validate_date(date)<br />
	{<br />
		var pattern= new RegExp(&#8220;^(0[1-9]|1[012])[/]?(0[1-9]|[12][0-9]|3[01])[/]?(2012)\$&#8221;);<br />
		return pattern.test(date);<br />
	}</p>
<p>if(!validate_date(data_date)){<br />
			alert(&#8216;Invalid Date. Correct format is dd/mm/yyyy&#8217;);<br />
			return false;<br />
		}</p>
<p>so, user may type / symbol only..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/comment-page-1/#comment-1625</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Tue, 02 Aug 2011 12:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/?p=797#comment-1625</guid>
		<description>Hi,
I wonder after testing date &quot;12/30-2011&quot; as an argument for ur regex pattern, which is giving true as return.

ur code is right but the patten u&#039;ve used is not absolute for date validation.

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I wonder after testing date &#8220;12/30-2011&#8243; as an argument for ur regex pattern, which is giving true as return.</p>
<p>ur code is right but the patten u&#8217;ve used is not absolute for date validation.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ch3etah</title>
		<link>http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/comment-page-1/#comment-1568</link>
		<dc:creator>ch3etah</dc:creator>
		<pubDate>Wed, 01 Jun 2011 21:19:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/?p=797#comment-1568</guid>
		<description>CED&#039;s regex expression is OK, still doesn&#039;t take into account the fact that 30/02/1945 is not a valid date. It&#039;s quite complicate to verify a date as a correct one. One might use SimpleDateFormat to validate it. The problem persist as 02/02/4325 is valid and yet not a valid DOB.
Great article nonetheless, as I&#039;m struggling with regex.</description>
		<content:encoded><![CDATA[<p>CED&#8217;s regex expression is OK, still doesn&#8217;t take into account the fact that 30/02/1945 is not a valid date. It&#8217;s quite complicate to verify a date as a correct one. One might use SimpleDateFormat to validate it. The problem persist as 02/02/4325 is valid and yet not a valid DOB.<br />
Great article nonetheless, as I&#8217;m struggling with regex.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/comment-page-1/#comment-1525</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 12 Apr 2011 20:09:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/?p=797#comment-1525</guid>
		<description>Bravo CED, you just saved a LOT of my time !</description>
		<content:encoded><![CDATA[<p>Bravo CED, you just saved a LOT of my time !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger</title>
		<link>http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/comment-page-1/#comment-1293</link>
		<dc:creator>Roger</dc:creator>
		<pubDate>Fri, 11 Feb 2011 13:57:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/?p=797#comment-1293</guid>
		<description>I have been struggling with regex for a good while in one of my project, which eventually one day becoma a working spider, but to be honest I have never thought that this tool can be used for date validatin also, thanks for sharing your knowledge Zaheer</description>
		<content:encoded><![CDATA[<p>I have been struggling with regex for a good while in one of my project, which eventually one day becoma a working spider, but to be honest I have never thought that this tool can be used for date validatin also, thanks for sharing your knowledge Zaheer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zhahmed</title>
		<link>http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/comment-page-1/#comment-1196</link>
		<dc:creator>Zhahmed</dc:creator>
		<pubDate>Mon, 25 Oct 2010 08:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/?p=797#comment-1196</guid>
		<description>great articles and great regex CED !! Thanks</description>
		<content:encoded><![CDATA[<p>great articles and great regex CED !! Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ced</title>
		<link>http://www.zparacha.com/how-to-validate-date-using-java-regular-expression/comment-page-1/#comment-1124</link>
		<dc:creator>Ced</dc:creator>
		<pubDate>Thu, 27 May 2010 20:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/?p=797#comment-1124</guid>
		<description>Your Date regex is incorrect; you have it set to collect months between 01-19 which isn&#039;t valid. 

it should be:

&quot;^(0[1-9]&#124;1[012])[- / ]?(0[1-9]&#124;[12][0-9]&#124;3[01])[- /]?(19&#124;20)\\d{2}$&quot;

Regardless, great explanations. I appreciate your explanations of the email, ssn, and phone. I didn&#039;t understand the syntax before. Now I do.</description>
		<content:encoded><![CDATA[<p>Your Date regex is incorrect; you have it set to collect months between 01-19 which isn&#8217;t valid. </p>
<p>it should be:</p>
<p>&#8220;^(0[1-9]|1[012])[- / ]?(0[1-9]|[12][0-9]|3[01])[- /]?(19|20)\\d{2}$&#8221;</p>
<p>Regardless, great explanations. I appreciate your explanations of the email, ssn, and phone. I didn&#8217;t understand the syntax before. Now I do.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

