Regular expression for validating numbers only

Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.To allow numbers with an optional decimal point followed by digits.

By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service.

If you enter a number then a space it works, but if you just input a space, it does not work. You're right on time again Sonu Kapoor, thanks again! It's very hard to find the right answer on this site, as only a handful of posters actually post the correct answer with no missing (essential) information.

You need TWO validator controls to ensure only numeric values are entered.

As written, re Snippet is designed to be dropped into other regular expressions, so you can extract (or avoid) numbers. ' // Optional exponent 0-29 for scientific notation.

Despite all the parentheses, it contains no capturing groups.

Leave a Reply

  1. science news dating connections 05-Nov-2019 19:23

    I am bisexual and looking for making some new friends the same i…

  2. sex dating in carbondale colorado 17-Nov-2019 17:36

    I knew I didn’t want a long-term relationship with him — he wasn’t my type — but I did find him attractive, so we booked a proper date.

  3. Dirty sex chat dating sites 10-Oct-2020 09:31

    Instead, members plan social activities to allow other members to meet each other in a comfortable, fun and relaxed atmosphere.