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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:40:09+00:00 2026-06-06T01:40:09+00:00

Am using the below expression to validate a textbox with decimal number. But it

  • 0

Am using the below expression to validate a textbox with decimal number. But it accept 12, -1.0,12.0,12.5,1.0 etc. But i want a regular expression like this “12.4”. First two digit and decimal point and followed by a single digit.

ValidationExpression="^-?[0-9]{0,2}(\.[0-5]{1,1})?$|^-?(100)(\.[0]{1,2})?$" 
  • 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-06T01:40:12+00:00Added an answer on June 6, 2026 at 1:40 am

    First of all, that regex is severely overcomplicated. The whole thing could be rewritten as

    ^-?([0-9]{0,2}(\.[0-5])?|100(\.00?)?)$
    

    …and have the exact same effect. But based on your comment, you’re looking for something much more strict:

    ^[0-9]{2}\.5$
    

    I’m not clear on why you want to do that, but this does exactly what you’ve described. If you don’t want to force the last digit to be 5 (your comment was unclear), use ^[0-9]{2}\.[0-9]$.

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

Sidebar

Related Questions

I am using the regular expression below to weed out any non-Latin characters. As
Hi am looking for an Regular Expression which parses QueryString.Am using the below regex:
How to write the regular expression for the below string using Javascript. [Account].&[1]+[Account].&[2]+[Account].&[3]+[Account].&[4] T
Possible Duplicate: Using regular expression within a stored procedure I need to validate a
I am trying to fill my datatable using LINQ expression below , this works
Using Visual Studio 2010 I would like to do a project level regular expression
I am using below URL to show line chart but one thing I have
I have a class that I am using below. And I am using this
i want to implement next previous functionality using below function. - (void)motionEnded:(UIEventSubtype)mt withEvent:(UIEvent *)event
I m just learning regular expression matching using javascript, and have a doubt regarding

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.