帮助正则表达式 [英] Help with Regex
问题描述
有人可以向我解释一下(?< Key>和(?< Value>
)在以下Regex表达式中是什么?
这将获取HTML字符串(文件)中的相对链接。
"(?< Key> href = [""''](?!#| http | ftp | mailto | javascript)(?< Value> [^""''] *)
["'''')"
这是用法:
reg =新正则表达式(_
"(?< Key> href = [""''](? !#| http | ftp | mailto | javascript)(?< Value>
[^""''] *)["'''')",_
RegexOptions.IgnoreCase _
或RegexOptions.Multiline _
或RegexOptions.Compiled)
什么对于Perl或任何其他的
Could someone please explain to me what the (?<Key> and (?<Value>
are in the following Regex expression?
This gets relative links in an HTML string (file).
"(?<Key>href=[""''](?!#|http|ftp|mailto|javascript)(?<Value>[^""'']*)
[""''])"
Here is usage:
reg = New Regex( _
"(?<Key>href=[""''](?!#|http|ftp|mailto|javascript)(?<Value>
[^""'']*)[""''])", _
RegexOptions.IgnoreCase _
Or RegexOptions.Multiline _
Or RegexOptions.Compiled)
What would that be as a standard Regex expression, for Perl or any other
regex engine?
推荐答案
mrclean,
他们是命名组,他们(应该)在Perl和其他正则表达式中是相同的/>
引擎。
教程&关于使用正则表达式的参考:
http://www.regular-expressions.info /
MSDN关于正则表达式的文档:
http://msdn.microsoft.com/library/de...geElements.asp
上述两个网站都提供有关指定群组的信息。
希望这有助于
Jay
The Cleaning Wonder Boy <先生***** @ baldy.com>在消息中写道
新闻:MP ************************ @ msnews.microsoft.c om ...
mrclean,
They are named groups, they would (should) be the same in Perl & other regex
engines.
A tutorial & reference on using regular expressions:
http://www.regular-expressions.info/
The MSDN''s documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp
Both of the above sites provide information on named groups.
Hope this helps
Jay
"The Cleaning Wonder Boy" <mr*****@baldy.com> wrote in message
news:MP************************@msnews.microsoft.c om...
有人可以向我解释一下(?< Key>和(?< Value>
在下面的Regex表达式中是什么?
这会得到相对的链接在HTML字符串(文件)中。
"(?< Key> href = [""''](?!#| http | ftp | mailto | javascript)(?< ;值> [^""''] *)
["'''')"
以下是用法:
reg =新正则表达式(_
"(?< Key> href = [""''](?!#| http | ftp | mailto | javascript)(?< Value>
[^""''] *)["''']",_
RegexOptions.IgnoreCase _
或RegexOptions.Multiline _
或RegexOptions.Compiled)
对于Perl或任何其他
正则表达式引擎,标准Regex表达式会是什么?
Could someone please explain to me what the (?<Key> and (?<Value>
are in the following Regex expression?
This gets relative links in an HTML string (file).
"(?<Key>href=[""''](?!#|http|ftp|mailto|javascript)(?<Value>[^""'']*)
[""''])"
Here is usage:
reg = New Regex( _
"(?<Key>href=[""''](?!#|http|ftp|mailto|javascript)(?<Value>
[^""'']*)[""''])", _
RegexOptions.IgnoreCase _
Or RegexOptions.Multiline _
Or RegexOptions.Compiled)
What would that be as a standard Regex expression, for Perl or any other
regex engine?
mrclean ,
他们如果是命名组,它们(应该)在Perl和amp;中是相同的。其他正则表达式
引擎。
教程&关于使用正则表达式的参考:
http://www.regular-expressions.info /
MSDN关于正则表达式的文档:
http://msdn.microsoft.com/library/de...geElements.asp
上述两个网站都提供有关指定群组的信息。
希望这有助于
Jay
The Cleaning Wonder Boy <先生***** @ baldy.com>在消息中写道
新闻:MP ************************ @ msnews.microsoft.c om ...
mrclean,
They are named groups, they would (should) be the same in Perl & other regex
engines.
A tutorial & reference on using regular expressions:
http://www.regular-expressions.info/
The MSDN''s documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp
Both of the above sites provide information on named groups.
Hope this helps
Jay
"The Cleaning Wonder Boy" <mr*****@baldy.com> wrote in message
news:MP************************@msnews.microsoft.c om...
有人可以向我解释一下(?< Key>和(?< Value>
在下面的Regex表达式中是什么?
这会得到相对的链接在HTML字符串(文件)中。
"(?< Key> href = [""''](?!#| http | ftp | mailto | javascript)(?< ;值> [^""''] *)
["'''')"
以下是用法:
reg =新正则表达式(_
"(?< Key> href = [""''](?!#| http | ftp | mailto | javascript)(?< Value>
[^""''] *)["''']",_
RegexOptions.IgnoreCase _
或RegexOptions.Multiline _
或RegexOptions.Compiled)
对于Perl或任何其他
正则表达式引擎,标准Regex表达式会是什么?
Could someone please explain to me what the (?<Key> and (?<Value>
are in the following Regex expression?
This gets relative links in an HTML string (file).
"(?<Key>href=[""''](?!#|http|ftp|mailto|javascript)(?<Value>[^""'']*)
[""''])"
Here is usage:
reg = New Regex( _
"(?<Key>href=[""''](?!#|http|ftp|mailto|javascript)(?<Value>
[^""'']*)[""''])", _
RegexOptions.IgnoreCase _
Or RegexOptions.Multiline _
Or RegexOptions.Compiled)
What would that be as a standard Regex expression, for Perl or any other
regex engine?
In文章< O0 ******* *******@TK2MSFTNGP12.phx.gbl>,
Ja **** ********@msn.com 说...
In article <O0**************@TK2MSFTNGP12.phx.gbl>,
Ja************@msn.com says...
mrclean,
他们是命名组,他们(应该)在Perl和amp中是相同的;其他正则表达式
引擎。
一个教程&关于使用正则表达式的参考:
http://www.regular-expressions.info /
本网站上没有关于它的内容..
MSDN关于正则表达式的文档:
http:// msdn.microsoft.com/library/de...geElements.asp
没有例子没什么帮助...
以上两个站点都提供了有关命名组的信息。
希望这有帮助
mrclean,
They are named groups, they would (should) be the same in Perl & other regex
engines.
A tutorial & reference on using regular expressions:
http://www.regular-expressions.info/
Nothing on this site about it..
The MSDN''s documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp
Not much help with no examples...
Both of the above sites provide information on named groups.
Hope this helps
并不像我想的那样有用。 。
Not really as helpful as I would like...
这篇关于帮助正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!