Regular Express - FInding non-numeric data in strings

Should be simple.  Just need a Reg Expression that would find non-numeric data in a string.  

For example

Column A
129.00                 -> Valid.  Decimal is OK
ABC                      -> Invalid  
A23                      --> Invalid
34                         --> Valid
9/22                     --> Invalid because of Slash
12&3                   --> Invalid because of &
300-AB               --> Invalid because of DASH and Alpha Chars
tmajor99Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Patrick MatthewsConnect With a Mentor Commented:
Note that the above pattern string will allow an entry like "123.45.678".  If that is what you want, you are all set.  If not, try:

^\d+(\.\d+)?$

That allows you to have a decimal portion, or not.  It does not accept numbers with commas as a thousand separator, though.  Do you need that?

Note: the above pattern returns a match if the entire input is a "valid number", and returns no match if not. So basically you are checking to see whether there is a match.
1
 
Rgonzo1971Commented:
Hi.,

pls try

[^\d\.]+
to find non num
or
[\d\.]+
to find num
Regards
0
All Courses

From novice to tech pro — start learning today.