找了半天没找到,这个MSDN我真的很不熟悉啊像Regex r = new Regex("^(?<name>\\w+):(?<value>\\w+)");
这是啥意思啊?

解决方案 »

  1.   

    http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/cpguide/html/cpconusingregularexpressionclasses.asp
      

  2.   

    "^(?<name>\\w+):(?<value>\\w+)"请问在哪里去寻找上面各个符号的解释?
    比如说\S \s
      

  3.   

    .
     Matches any character except \n
     
    [characters]
     Matches a single character in the list
     
    [^characters]
     Matches a single character not in the list
     
    [charX-charY]
     Matches a single character in the specified range
     
    \w
     Matches a word character; same as [a-zA-Z_0-9]
     
    \W
     Matches a nonword character
     
    \s
     Matches a whitespace character; same as [\n\r\t\f]
     
    \S
     Matches a nonwhitespace character
     
    \d
     Matches a decimal digit; same as [0-9]
     
    \D
     Matches a nondigit character
     
    ^
     Beginning of the line
     
    $
     End of the line
     
    \b
     On a word boundary
     
    \B
     Not on a word boundary
     
    *
     Zero or more matches
     
    +
     One or more matches
     
    ?
     Zero or one matches
     
    {n}
     Exactly n matches
     
    {n,}
     At least n matches
     
    {n,m}
     At least n but no more than m matches
     
    ( )
     Capture matched substring
     
    (?<name>)
     Capture matched substring into group name
     

     Logical OR
     
      

  4.   

    ?<something>
     Capture the matched substring into a group named “something”.
     
    \
     Escape the following expression, which has a special meaning to Regex.
     
    \w
     A pattern that matches any “word” character (in other words, any alphabetic, numeric, or underscore character)—the same pattern as [a-zA-Z_0-9].@
     “Escape” the \ in the pattern so that \s is treated as a single regular expression metacharacter.
     
    ^
     At the beginning of the line…
     
    \s
     …match any whitespace character (space, tab, and so on)
     
    +
     …and any number of them.
     
    还有一些特殊格式的 比如日期 html IP
    这是从inside C#中找的 先用着 
    +
     Allow for multiple instances of this pattern (in this case, any “word” characters).
     
    :
     Split the string at this delimiter.
     
    ?<another>\\w+
     Capture the matched substring into a group named “another”, matching any “word” characters.
     
      

  5.   

    yizhixiaozhu(一只小猪) 提供的地址应该是你要找的上边的格式有点乱 sorry
      

  6.   

    ms-help://MS.NETFrameworkSDKv1.1.CHS/cpguidenf/html/cpconcomregularexpressions.htm