1.正则,以“this.Name”开头,以“;”结尾
string regex="this\\.Name(.*?);";
string regex="this\\.Name(.*?);";
以size开头,以数字结尾。
string input="size0"; string regex = "size\\d"; if (Regex.IsMatch(input, regex)) { } input = "sizeA"; if (Regex.IsMatch(input, regex)) { }
2.其它:
"^[A-Za-z0-9]+$" //由数字和26个英文字母组成的字符串

浙公网安备 33010602011771号