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 8161997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:36:56+00:00 2026-06-06T18:36:56+00:00

I have the following regex which validates dates: //are not both dates if (!methods._isDate(first[0].value)

  • 0

I have the following regex which validates dates:

//are not both dates
if (!methods._isDate(first[0].value) || !methods._isDate(second[0].value)) {
    return options.allrules[rules[i]].alertText +   
           options.allrules[rules[i]].alertText2;
}

Regex below :

_isDate: function (value) {
             var dateRegEx = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/);
             return dateRegEx.test(value);
         },

But this looks like for mmddyy, and my date is always ddmmyy.

Can you rewrite this regex? Please check it.

  • 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-06T18:36:57+00:00Added an answer on June 6, 2026 at 6:36 pm

    For DDMMYYYY, with optional leading 0 for day and month, separators / or -, years 1900–2099, without checking validity of 29., 30. or 31. day in month it would be:

    /^(0?[1-9]|[12]\d|3[01])[\/\-](0?[1-9]|1[012])[\/\-](19\d{2}|20\d{2})$/
    

    To use just 2-digit year format go with:

    /^(0?[1-9]|[12]\d|3[01])[\/\-](0?[1-9]|1[012])[\/\-](\d{2})$/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following JS regex which breaks the code and not working as it
I have the following regex: /[0-9#%@_$&!?^\/|*<>]+/i which is not supposed to accept letters. It
I might have pretty basic question about regex. I have the following regex, which
I have the following regex ^[a-zA-Z0-9]+$ which would allow alpha numeric characters. The problem
I have the following regex which suppose to match email addresses: [a-z0-9!#$%&'*+\\-/=?^_`{|}~][a-z0-9!#$%&'*+\\-/=?^_`{|}~.]{0,63}@[a-z0-9][a-z0-9\\-]*[a-z0-9](\\.[a-z0-9][a-z0-9\\-]*[a-z0-9])+$. I have
I have created the following regex which matches either 9 consecutive numbers or 14
I have this phone number: +44 (0) 1234 123456 which the following regex is
I have following input: MaintanceGie?\195?\159mannFlock SupportGie?\195?\159mannFlock ABCSaskDgfskSblabla And search for a regex which gives
I am white-belt regex. I have the following regex which sort of works except
I have a Regex which contains the following .Is this suitable restricting the user

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.