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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:10:23+00:00 2026-05-13T11:10:23+00:00

I need to check by Regex expression if 9 or 14 digits are typed.

  • 0

I need to check by Regex expression if 9 or 14 digits are typed.

The expression \d{9}|\d{14} seems to be not working properly, what’s wrong ?

  • 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-13T11:10:23+00:00Added an answer on May 13, 2026 at 11:10 am

    This regex should work.

    ^(\d{9}|\d{14})$
    

    Could you post the piece of code you’re using and tell us what language are you using?
    If you’re using regex chances are that you have a string, and I’m sure your language has something to count string length.

    EDIT:
    as Rubens Farias pointed out in comments maybe ^…$ is needed because your regex would match any number with more than 9 digit as that number has a substring with a 9 digit long number.

    Anyway check if you can do it with your language’s string’s methods/functions

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

Sidebar

Related Questions

good evening, i need to check if the input match my regex or not
Not a regex expert, but I know enough to be dangerous, need some help
I am using Zend_Validate_Regex, I need the regular expression which has the following check,
I need to form a regular expression in order to check the outputs of
I want to check a name using regular expression, but I'm not getting convincing
I need to check using regex that a string matches this format: http://site.com/users/1 e.g.
I need make a regex expression to validate an external string. I'm building a
I need to check in some fast way if there is any text nodes
I need to check whether a given date is in the preceding month for
I need to check if a database is totally empty (no tables) using 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.