runliuv

runliuv@cnblogs

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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个英文字母组成的字符串

 

posted on 2013-12-27 15:13  runliuv  阅读(304)  评论(0)    收藏  举报