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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:45:59+00:00 2026-05-13T22:45:59+00:00

in my application i want to validate the telephone numbers, how can i write

  • 0

in my application i want to validate the telephone numbers, how can i write regular expression for telephone numbers like..

040-23357399 or 04023357399
91-40-23357399 or 914023357399
08518-2814655 or 085182814655
91-8518-2814655 or 9185182814655

this is my phone numbers how can i write the expression for this

  • 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-13T22:46:00+00:00Added an answer on May 13, 2026 at 10:46 pm

    Validation implies rejection, and your users will find that annoying. A better option is to accept as much as possible by first stripping all non-digits from the string, and then checking the length and initial digits vs a few simple rules:

    • If 11 digits and starts with a 1, strip first digit.
    • If 10 digits accept if it starts with 2-9.
    • If 12-14 digits accept if starts with a valid country code.
    • Rreject everything else.

    This passes a lot more through than trying to force your users into a specific format, and makes for simpler, faster validation code. Then you just format it nicely whenever you re-display it.

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

Sidebar

Related Questions

in my web application i want to validate that user can enter only digits
I want to write a Java application that validate files and directories according to
I want to write a web application and want to use Ruby. I have
In my iPhone application i want do draw different shapes like line, circle and
In my ios application i want to store an object's reference. This object can
I want to validate landphone and mobile phone fields in my CI application. I
i have a web application in php with html5, want to validate in html5,
what will be the regular expression of date format like '01-Aug-12'. I have the
I have a Java EE application and I want to validate a Date. With
Question In a Windows C application I want to validate a parameter passed into

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.