Dear all,
I wrote a regular expression
^([+/-]?([0-9]+(.)?)|([0-9]*.[0-9]+))$
I create it by two ways
var _regex = "^([+/-]?([0-9]+(\.)?)|([0-9]*\.[0-9]+))$";
var _regexFloat = new RegExp(_regex);
and
var _regexFloat = /^([+/-]?([0-9]+(\.)?)|([0-9]*\.[0-9]+))$/ ;
the testing data is "1a" and "a1".
at the second way, it work fine.
but in the first way, it returns true.
Can anyone suggest me if I have something wrong.
Thanks very much.
Environment:
Windows Server 2003
IE 6