regex - Find & replace multiple keywords defined string -
i'm trying remove following string/line in sql database:
<p><span style="font-size:16px"><strong>the quick brown </strong></span><strong><span style="font-size:16px">fox jumps.</span></strong></p>
- string start
<p>
, end</p>
- string contain these words, in same order:
the
,quick
,brown
. might separated else (space,
or other html tags) - string part of field more text, nested html tags, solution must ignore higher level
<p></p>
tags. - we talking +20k matches, no manual edits solutions please :)
i have tried doing regexp can't filter multiple keywords (and
operator).
i can export db sql file can use solution recommend, windows/linux, text editor, js script etc. appreciate simplest , elegant solution.
i think have restrict .*
non-efficient more precise (?:(?!<\/?p[^<]*>).)*
force match words inside 1 <p>
tag:
(?i)<p>(?:(?!<\/?p[^<]*>).)*the(?:(?!<\/?p[^<]*>).)*?quick(?:(?!<\/?p[^<]*>).)*?brown(?:(?!<\/?p[^<]*>).)*?<\/p>
see demo
Comments
Post a Comment