Visual Studio C# Regular Expressions Examples
Numeric values:
public bool isNumeric(string str) {
Regex pattern = new Regex("[^0-9]");
return !pattern.IsMatch(str);
}
Alfa values:
private bool IsAlpha(string str) {
Regex pattern = new Regex("[^a-zA-Z]");
return !pattern.IsMatch(str);
}
Alfa numeric values:
private bool isAlfaNumeric(string str) {
Regex pattern = new Regex("[^a-zA-Z0-9]");
return !pattern.IsMatch(str);
}