次のような HTML に複数のネストされた引用符があります。
<div class="quote-container">
<div class="quote-block">
<div class="quote-container">
<div class="quote-block">
</div>
</div>
<div class="quote-container">
<div class="quote-block">
</div>
</div>
<div class="quote-container">
<div class="quote-block">
</div>
</div>
</div>
</div>
引用符を検索して削除する必要があります。私は表現を使用します:
<div class="quote-container">.*<div class="quote-block">.*</div>.*</div>
これは一重引用符で機能します。ただし、複数のネストされた引用符には問題があります (上記の例)。
私の仕事は、次のものを検索することです。
<div class="quote-container">.*<div class="quote-block">
を含まない任意の文字列に加えて
<div
で終わる
.*</div>.*</div>
次のような後読みアサーションと先読みアサーションを試しました。
<div class="quote-container">.*<div class="quote-block">.*(?!<div).*</div>.*</div>
しかし、それらは機能しません。
私の仕事をする方法はありますか?TextPipe で使用できる perl 式が必要です (フォーラムの解析に使用し、後でテキストから音声への変換を行います)。
前もって感謝します。