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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:03:34+00:00 2026-05-23T15:03:34+00:00

i try to allow only number 01 (1) to 53) after / and after

  • 0

i try to allow only number 01 (1) to 53) after / and after 2000 and over….
so i create a regex but it don’t seem to work

on this web page: http://www.regular-expressions.info/javascriptexample.html
i tried it and it work well… but when i test in on a web page

10/2010 , 23/2000

function isValidDate(value, format){
     var isValid = true;

     try{
         var inputVal = $(this).val();
         var dateWWYYYYRegex = '^(0[1-9]|[1234][0-9]|5[0-3])[-/.](20)\d\d$';

         var reg=new RegExp(dateWWYYYYRegex);

         if(!reg.test(value)){
            isValid = false;
            alert("Invalid");
         }

     }
     catch(error){
         isValid = false;
    }

    return isValid;
}
  • 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-23T15:03:35+00:00Added an answer on May 23, 2026 at 3:03 pm

    You have to escape backslashes if you’re going to make a regex from a string. I’d just use regex syntax, since it’s a constant anyway:

    var reg = /^(0[1-9]|[1234][0-9]|5[0-3])[-/.](20)\d\d$/;
    

    The regular expression doesn’t really make any sense, however. It’s not clear what it should be, because your description is also confusing.

    edit — OK now that I see what you’re doing, that regex should work, I guess.

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

Sidebar

Related Questions

I have tried contacting tech support with this question, but it has been over
I will try to explain this the best way I can, but feel free
Apparently ICMP isn't the only way to create a Traceroute. This and this answer
Traditionally, we try to avoid LazyInitializationException s. However, I need to temporarily allow them
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
try: recursive_function() except RuntimeError e: # is this a max. recursion depth exceeded exception?
hi i know where my code is going wrong, but don't know how to
I have a python script that I want to only allow to be running
I have following regular expression: ^-?([0-9]{0,3}$|[0-9]{0,2}\.?[0-9]{0,1}$) It should not allow 4 digit number such

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.