Hi Experts,
Could you please help me find Function to Test for Positive Number both Integer & Real ?
It is too urgent Please answer at the earliest
Thanks
Rajesh
Regular expression to Test for Positive Number both Integer & Real
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Baimey RajeshRank #1,338 · 1.3K reputationPosted Mar 29, 2011, 1:23 AM EDT
Please try this piece of code
public bool IsPositiveNumber(String strNumber)
{
Regex objNotPositivePattern=new Regex("[^0-9.]");
Regex objPositivePattern=new Regex("^[.][0-9]+$|[0-9]*[.]*[0-9]+$");
Regex objTwoDotPattern=new Regex("[0-9]*[.][0-9]*[.][0-9]*");
return !objNotPositivePattern.IsMatch(strNumber) &&
objPositivePattern.IsMatch(strNumber) &&
!objTwoDotPattern.IsMatch(strNumber);
}
U'll get more Reg Exp from
http://www.c-sharpcorner.com/UploadFile/prasad_1/RegExpPSD12062005021717AM/RegExpPSD.aspx