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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:52:49+00:00 2026-06-12T07:52:49+00:00

I need a regular expression that satisfy these rules: The maximum number of decimal

  • 0

I need a regular expression that satisfy these rules:

  1. The maximum number of decimal point is 3 but a number with no decimal point (e.g 12) should be accepted too
  2. the value must be at least 0
  3. the value must be less or equal to 99999999999.999
  4. the radix point is DOT (e.g 2.5, not 2,5)

Sample of valid numbers:

0
2
0.4
78784764.23
45.232

Sample of invalid numbers:

-2
123456789522144
84.2564

I found an example here (http://forums.asp.net/t/1642501.aspx) and have managed to modify it a little bit to make 0 as the minimum value, 99999999999.999 as the maximum value and to accept only DOT as radix point. Here’s my modified regex:

^\-?(([0-9]\d?|0\d{1,2})((\.)\d{0,2})?|99999999999.999((\.)0{1,2})?)$

However, I still have problem with the 3 decimal point and it is rather unstable. Can anyone help me on this since I’m basically illiterate when it comes to regex?

Thanks.

EDITED:
I’m using ASP Regular Expression Validator

  • 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-12T07:52:51+00:00Added an answer on June 12, 2026 at 7:52 am

    This is not that difficult:

    ^[0-9]{1,11}(?:\.[0-9]{1,3})?$
    

    Explanation:

    ^            # Start of string
    [0-9]{1,11}  # Match 1-11 digits (i. e. 0-99999999999)
    (?:          # Try to match...
     \.          # a decimal point
     [0-9]{1,3}  # followed by one to three digits (i. e. 0-999)
    )?           # ...optionally
    $            # End of string
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a regular expression that should validate decimal point as well as range.
I need to write a regular expression that will be correct for telephone number
I need a regular expression that accepts only digits and dots, with these conditions:
I need a regular expression that will replace odd number of slashes with even
I need a regular expression that can match an unknown number of groupings in
I need a regular expression that requires at least ONE digits and SIX maximum.
I need a regular expression that will find lines with: <cflocation url=index.cfm addtoken=No> but
I need a regular expression that accept numbers, spaces and hyphen with a maximum
I need a regular expression that validate for a number with length 4, 5,
I need to create a regular expression to match strings that satisfy any two

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.