HTMLコンテンツを解析し、コンテンツをAからBに保持したい例:
some content1...
<!-- begin_here -->
some content2
<!-- end_here -->
some content3
となります
<!-- begin_here -->
some content2
<!-- end_here -->
ここで、sed を使用して次のことを行います。
sed '/begin_here/,/end_here/!d' file.html > file2.html
ただし、クロスプラットフォームの目的で python を使用して書き直したいと思います。私はPythonでの正規表現にあまり慣れていません。これを行うためのヒントを教えてください。どうもありがとう :)