Home > ASP.Net > ASP.NET Regular Expression for date format

ASP.NET Regular Expression for date format


In ASP.Net Many times required to Validate Date Fromat Enter in Control.in Regular Expression Following RE used to Validate Date Format.

dd/mm/yyyy Format (optional mm,optional dd)
([1-9]0[1-9][12][0-9]3[01])[- /.]([1-9]0[1-9]1[012])[- /.][0-9]{4}$

mm/dd/yyyy (optional mm,optional dd)
^([1-9]0[1-9]1[012])[- /.]([1-9]0[1-9][12][0-9]3[01])[- /.][0-9]{4}$

mm/dd/yyyy (Exact Format)
^([01]\d)/([0-3]\d)/(\d{4})$

Good Luck

Advertisements
Categories: ASP.Net
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: