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

  • Home
  • SEARCH
  • 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 8855797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:13:02+00:00 2026-06-14T14:13:02+00:00

I would like to validate http request parameters in Express (and express-param) using regular

  • 0

I would like to validate http request parameters in Express (and express-param) using regular expressions.
This parameter must be a number with 11 digits at least.

Why app.param('uid', /^[0-9]{11,}+$/); returns an error?

And why app.param('uid', /^[0-9]{11,}/); don’t works fine?
It blocks params like 1234567890c and accepts 12345678901c or 12345678901ca.

  • 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-14T14:13:04+00:00Added an answer on June 14, 2026 at 2:13 pm

    Your two patterns are inconsistent. The first (which is an invalid regex) has an ending $ specifying that the input must match your pattern up to the end of the string. The problem is you have a + after the numbers which causes it to be invalid as you specify the number of times it should repeat already with {11,}.

    The second pattern drops both the + and the $. Dropping the + is perfect, however, when you drop the $ you say that anything after the numbers can appear.

    Try adding a $ to the second pattern:

    app.param('uid', /^[0-9]{11,}$/);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to validate an email using the RegexValidator, e.g. [RegexValidator(@^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$)] Which works
I would like to validate the DNF (Disjunctive normal form) which looks like this
I am receiving this XML file which I would like to validate. Ideally I
I'm using jQuery Validate and would like to re-validate a group of fields whenever
I would like to create a regex to validate customer names. This would be
I would like to validate a form so that it checks if the user
I would like to validate and restrict newline/linefeed character. Valid XML: <root> <node>data data</node>
I would like to validate IP addresses from a list that may contain incorrectly
I would like to know how can we validate the Credit Card. We have
I would like to use a pre-commit hook in riak to validate the json

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.