我试图在VS 2012中使用Regular expression
找到与该格式匹配的字符串:
<data anything here>
</data>
答案 0 :(得分:2)
这应该可以解决问题:
^<data ([^>]+)>\r\n</data>
答案 1 :(得分:2)
<强>正则表达式强>
\<data ([^\>]+)\>\r\n\<\/data\>
正则表达式描述:
\< matches the character < literally
data matches the characters data literally (case insensitive)
1st Capturing group ([^\>]+)
[^\>]+ match a single character not present in the list below
Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
\> matches the character > literally
\> matches the character > literally
\r matches a carriage return (ASCII 13)
\n matches a line-feed (newline) character (ASCII 10)
\< matches the character < literally
\/ matches the character / literally
data matches the characters data literally (case insensitive)
\> matches the character > literally
注意: 这会将anything here
文本捕获到捕获组1中,您可以在Visual Studio中使用{{1}替换}符号。