Regex Expression for IsNumeric Function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LoanB
    New Member
    • Nov 2007
    • 62

    Regex Expression for IsNumeric Function

    Hi There I have the following code which checks if a input data is Numeric.

    private bool IsNumeric(strin g subject)
    {
    return (System.Text.Re gularExpression s.Regex.IsMatch (subject, "^[-0-9]*.[.0-9].[0-9]*$"));
    }

    It works, but I want it to include blank spaces EG if a phone number is input, I want to leave a space between an area code and the number.

    Can someone please help me redefine the expression to include blank spaces I think it uses \t but I'm not sure how to include it in the expression.

    Thanks in advance,

    Lóan
Working...