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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:41:02+00:00 2026-05-20T23:41:02+00:00

I was surfing online for date validation, but didn’t exactly understand the regex. Can

  • 0

I was surfing online for date validation, but didn’t exactly understand the regex. Can anyone explain it? I’m confused with ?, {} and $. Why do we need them?

dateReg = /^[0,1]?\d{1}\/(([0-2]?\d{1})|([3][0,1]{1}))\/(([1]{1}[9]{1}[9]{1}\d{1})|([2-9]{1}\d{3}))$/;
  • 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-05-20T23:41:02+00:00Added an answer on May 20, 2026 at 11:41 pm
    ^ = beginning of the string
    [0,1]? = optional zero, one or comma (the comma is probably an error)
    \d{1} = exactly one digit (the {1} is redundant)
    \/ = a forward slash
    [0-2]? = optional zero, one or two (range character class) followed by any single digit (\d{1})
    OR [3] = three (character class redundant here) followed by exactly one zero, one or comma 
    \/ = forward slash
    [1]{1}[9]{1}[9]{1}\d{1} = 199 followed by any digit
    OR 2-9 followed by any 3 digits
    

    Overall, that’s a really poorly written expression. I’d suggest finding a better one, or using a real date parser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to understand Ruby a bit better, I ran into this code surfing the
I have been surfing for this anwser, but seems like its not supportef in
After some googling and stackoverflow surfing, i didn't find any description of my problem,
I'm trying to redirect anyone surfing to http://forum.student.khleuven.be to http:// forum.kringraad.be. Both URL's redirect
Surfing the net I ran into Aquabrowser (no need to click, I'll post a
if I'm using the emulator of android-sdk and surfing to a website, how can
I've been hardly searching info about working with VS and TFS, but after surfing
Well, I didn't really know how to call this... I have been surfing PayPal's
This is a very simple question, but after a few hours surfing the web
I was surfing on the Net a lot, but still I haven't found an

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.