Regular Expression for Integer and Float

  • Thread starter Thread starter TARUN
  • Start date Start date
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
 
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
 
Back
Top