• λ我爱Aspx >> Asp.Net >> C#正则表达式应用范例
  • C#正则表达式应用范例

  • :未知  Դ:internet  :2007-5-20 16:44:08  ؼ:c#
  • Regex objNumberPattern =new Regex("(" + strValidRealPattern +")|(" + strValidIntegerPattern + ")");

    return !objNotNumberPattern.IsMatch(strNumber) &&

    !objTwoDotPattern.IsMatch(strNumber) &&

    !objTwoMinusPattern.IsMatch(strNumber) &&

    objNumberPattern.IsMatch(strNumber);

    }

    // Function To test for Alphabets.

    public bool IsAlpha(String strToCheck)

    {

    Regex objAlphaPattern=new Regex("[^a-zA-Z]");

    return !objAlphaPattern.IsMatch(strToCheck);

    }

    // Function to Check for AlphaNumeric.

    public bool IsAlphaNumeric(String strToCheck)

    {

    Regex objAlphaNumericPattern=new Regex("[^a-zA-Z0-9]");

    return !objAlphaNumericPattern.IsMatch(strToCheck);

    }

    }

    There is another simple way to perform these validation think of it while the next article comes.

    Ҷƪл˵?
  • һƪ使用C# 编写扩展存储过程
    һƪASP生成静态网页的方法