Link to home
Start Free TrialLog in
Avatar of Jay Roy
Jay RoyFlag for United States of America

asked on

regular expression:- validate string of numbers

hi guys

I am looking for a regular expression which will check if there are
any alphabets in a string of numbers.  
i am using

public function isValidNumber(s:String):Boolean{
return Boolean(s.match(/^[0-9]+$/));
}

if i enter s = 55e or s = 6567y  it returns false which is fine
but when i enter
s = 99.99
it returns false.

When decimal numbers example 99.99 is entered i want it to return true but when
99.aa is entered i want it to return false.

any idea how i can change my above function ?

thanks
ASKER CERTIFIED SOLUTION
Avatar of Terry Woods
Terry Woods
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial