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.
I am bisexual and looking for making some new friends the same i…
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.
Instead, members plan social activities to allow other members to meet each other in a comfortable, fun and relaxed atmosphere.