Hi,

I am trying to use a regular expression to validate numbers.

For e.g.:

-1

+1

1.23456n

123456n.123456n

1,234,567n

1,234,567n.123456n

-1,234,567n.123456n

+1,234,567n.123456n

So its basically any kind of a valid number. [Any number of digits before or after decimal place. The decimal point (may or may not occur) only once throughout and the commas(may or may not occur) any number of times.]

The regular expression that I used is this:

**^[-+]?[\\,\\d]*\\.?\\d*$**
But it fails

for as simple a number as

**-1** and works for

**+1**
Please help. Any suggestions for new regular expression satisfying the above conditions is also welcome

-Ninad