Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:17:37+00:00 2026-06-14T18:17:37+00:00

my string format are in M/d/yyyy. Which means there will be no zero in

  • 0

my string format are in M/d/yyyy. Which means there will be no zero in front of the month and date digit.
example: 9/23/2012, 7/9/2012 etc

I have tried:

^((((0?[1-9]|[12]\d|3[01]).-/.-/)|((0?[1-9]|[12]\d|30).-/.-/)|((0?[1-9]|1\d|2[0-8])[.-/]0?2.-/)|(29[.-/]0?2.-/))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$

but i guess this is for d/M/yyyy.

Anyone have the expression for M/d/yyyy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:17:39+00:00Added an answer on June 14, 2026 at 6:17 pm

    If you are trying to validate if the Date is in format M/d/yyyy then DateTime.TryParseExact is a better solution then Regex. Something like.

    string str = "9/23/2012";
    DateTime dt;
    if(DateTime.TryParseExact(str,
                              "M/d/yyyy",
                              CultureInfo.InvariantCulture,
                              DateTimeStyles.None, 
                              out dt))
    {
        //valid date
    }
    else
    {
        //Invalid date
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am have a string named begin_date which contain date in the format dd.mm.yyyy
I have a date in String format, mm/dd/yyyy I want to convert this to
Is there a string format of a date that a Date object can be
I am trying to convert date which is in string and got format of
I am parsing multiple String objects containing date in format of mm/dd/yyyy into Date
I want to convert my date (which is in String format), e.g. 13-09-2011, into
I have a string which is allways in this format: 7 May 2012 or
I want to get the format of a given date string. Example: I have
String date = new java.text.SimpleDateFormat(MM-dd-yyyy).format(new java.util.date()); upload.uploadfile(192.168.0.210, muruganp, vm4snk, /home/media/Desktop/FTP Upload/+date+_RB.zip, /fileserver/filesbackup/Emac/+date+_RB.zip); uploadfile is
A string has the value in dd/MM/yyyy format like 04/10/2012 . This should be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.