找了半天没找到,这个MSDN我真的很不熟悉啊像Regex r = new Regex("^(?<name>\\w+):(?<value>\\w+)");
这是啥意思啊?
这是啥意思啊?
解决方案 »
- c#中在sql 数据中查询
- webbrowse网页里的文件加载前如何取得其消息
- 自己写了个web service,却得不到想要的结果,请高手进来看一下,急!!
- 谁知道怎样引入mshtml命名空间啊??
- 如何編譯成dll的問題??
- C#windform中如何设置一个全局变量?
- 问个简单问题:请推荐个非打印字符在字符串中做字符串的分隔用
- 诚征大神求解codility上的测试题,智力和能力大考验!(我是被打击惨了,看看大神们如何吧)
- 初学C#,遇到几个问题一直没能解决,请大家帮忙看看
- c#中出现的emoji表情的解析问题
- C#如何得到每月的最后一天
- 关于用C#设计KWIC(KEY WORD IN CONTEXT)系统设计模块,看不懂:(在线等注释,非常感谢!HELP!!给分答谢哦:)
比如说\S \s
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
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.