.NET
特定のタグを取得するために、プロジェクトで正規表現に取り組んでいます。DIV タグ全体とその内容を一致させたい:
<html>
<head><title>Test</title></head>
<body>
<p>The first paragraph.</p>
<div id='super_special'>
<p>The Store paragraph</p>
</div>
</body>
</head>
コード:
Regex re = new Regex("(<div id='super_special'>.*?</div>)", RegexOptions.Multiline);
if (re.IsMatch(test))
Console.WriteLine("it matches");
else
Console.WriteLine("no match");
私はこれを一致させたい:
<div id="super_special">
<p>Anything could go in here...doesn't matter. Let's get it all</p>
</div>
すべての文字を取得するはずだった.
のですが、キャリッジ リターンに問題があるようです。私の正規表現には何が欠けていますか?
ありがとう。