Regular expression to validate whether the data contains numeric ( or empty is also valid)

Posted by VinnaKanna on Stack Overflow See other posts from Stack Overflow or by VinnaKanna
Published on 2010-03-31T07:11:51Z Indexed on 2010/03/31 7:13 UTC
Read the original article Hit count: 359

Hi all,

i have to validate the data contains numeric or not and if it is not numeric return 0 and if it is numeric or empty return 1.

Below is my query i tried in SQL SELECTdbo.Regex('^[0-9]','123') --- This is returning 1 SELECTdbo.Regex('^[0-9]','') -- this is not returning 1 but i want to return as 1 and i try to put space in "pattern" also it is not working...

please can any one help....

Thanks in advance

© Stack Overflow or respective owner

Related posts about regular-expression

Related posts about regex