[Csharp]
Private static Regex RegPhone = new Regex ("^ [0-9] + [-]? [0-9] + [-]? [0-9] {1} $ ");
Private static Regex RegNumber = new Regex ("^ [0-9] + {1} $ ");
Private static Regex RegNumberSign = new Regex ("^ [+-]? [0-9] + {1} $ ");
Private static Regex RegDecimal = new Regex ("^ [0-9] + [.]? [0-9] + {1} $ ");
Private static Regex RegDecimalSign = new Regex ("^ [+-]? [0-9] + [.]? [0-9] + {1} $ "); // equivalent to ^ [+-]? \ D + [.]? \ D + $
Private static Regex RegEmail = new Regex ("^ [\ w-] + @ [\ w-] + \\. (com | net | org | edu | mil | TV | biz | info) {1} $ "); // a string of letters or numbers, the same as the [a-zA-Z0-9] syntax
Private static Regex RegCHZN = new Regex ("[\ u4e00-\ u9fa5]"); // specifies whether Chinese characters are available
Example:
[Csharp]
# Region Chinese Detection
/// <Summary>
/// Check for Chinese Characters
/// </Summary>
/// <Param name = "inputData"> </param>
/// <Returns> </returns>
Public static bool IsHasCHZN (string inputData)
{
Match m = RegCHZN. Match (inputData );
Return m. Success;
}
# Endregion
From the column keenweiwei