Regular Expression for Integer and Float

T

TARUN

Hello All

I want to ask regading regular expression.
I want to use such regular expression which only allow integers and
float value.
for example :--

12
12.34
23.456
0.5
0.0
0

I found but not able to find. Please Help me . Suggest me the regular
expression for that


with regards
Tarun sinha
 
A

Andrew Morton

TARUN said:
I want to use such regular expression which only allow integers and
float value.
for example :--

12
12.34
23.456
0.5
0.0
0

I found but not able to find. Please Help me . Suggest me the regular
expression for that

You really could have googled for "regular expression number" to find an
answer like the "//Function to test whether the string is valid number or
not" section at
http://www.c-sharpcorner.com/Language/RegExpressionSample1.asp

You didn't mention if number formats like 1.23e34, which is valid for a
floating-point number, or negative numbers were acceptable for your purpose.

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top