何百ものSQLInsertステートメントを含むファイルがあります。HTML段落タグで始まるステートメントのみを識別したいのです<p>
が、終了段落タグがありません</p>
。
私はこれらの行を試しています
<p>[^\n]*(?!</p>) <-- a <p> followed by any number of characters until \n and then </p>
これは動作しません。以下はサンプルデータです
INSERT INTO `help` VALUES
(1,1,'<p>Radiotherapy uses a beam of high-energy rays (or particles) lymph nodes.</p>'),
(2,1,'<p>EBRT delivers radiation from a machine outside the body. '),
(3,1,'<p>Following lumpectomy radiotherapy <ul><li>Heading</li></ul></p>'),
理想的には</p>
、それらが存在しない場所、たとえば挿入ステートメント#2に追加します。