Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はいくつかのテキストを持っています
のようなタグ
<p>This is text a</p><p>This is text ended without p</a>
正規表現を使用して両方のクラスを照合し、InnerTextを抽出したいと思います。
const string patternDesp = @"<p>(.+?)(</p>|</a>)";
しかし、を見ると、m.Groups[1]1つの一致しか返されません。m.Groups[2]私にくれます
m.Groups[1]
m.Groups[2]
</a>
MatchCollectionこの問題を修正しました。の代わりに使用する必要があるようですMatch。
MatchCollection
Match