正则,以“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))
            {
            }
原文地址:https://www.cnblogs.com/runliuv/p/3494198.html