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> <p class="calibre2">
ただし、「.」のように句読点が前に付いているものは除きます。また "?" また "!"
なので以下を削除
Hello</p> <p class="calibre2"> World
--> 必要な「Hello World」を出力します
ただし、以下は変更せずにそのままにしておきます。
Hello.</p> <p class="calibre2"> World
これはsedである必要がありますか? パールはどうですか?
perl -0777 -pe 's{(?<![[:punct:]])</p>\s*<p class="calibre2">}{}g' file