• λ我爱Aspx >> Asp.Net >> 解读C#中的规则表达式(正则表达式)
  • 解读C#中的规则表达式(正则表达式)

  • :未知  Դ:非寒日志  :2007-4-21 0:46:13  ؼ:
  • MatchCollection mc14 = Regex.Matches(t14, p14);

    找出所有的大写字母

    string t15 = "This IS a Test OF ALL Caps";

    string p15 = @"(\b[^\Wa-z0-9_]+\b)";

    MatchCollection mc15 = Regex.Matches(t15, p15);

    找出小写的单词

    string t16 = "This is A Test of lowercase";

    string p16 = @"(\b[^\WA-Z0-9_]+\b)";

    MatchCollection mc16 = Regex.Matches(t16, p16);

    找出第一个字母为大写的单词

    string t17 = "This is A Test of Initial Caps";

    string p17 = @"(\b[^\Wa-z0-9_][^\WA-Z0-9_]*\b)";

    MatchCollection mc17 = Regex.Matches(t17, p17);

    找出简单的HTML语言中的链接

    string t18 = @"

    <html>

    <a href="http://www.5iaspx.com/first.htm>first" tag text</a>

    <a href="http://www.5iaspx.com/next.htm>next" tag text</a>

    </html>

    ";

    string p18 = @"<A[^>]*?HREF\s*=\s*[""']?" + @"([^'"" >]+?)[ '""]?>";

    MatchCollection mc18 = Regex.Matches(t18, p18, "si");

    Ҷƪл˵?
  • һƪ.net打包自动安装数据库
    һƪC#中的特性(Attributes)