Reputation: 2639
Using regex in JavaScript, how would I replace the following tags with an empty string?
<p> </p>
<p> </p>
<p> </p>
<p> </p>
.
..
...
There could be any number of
entities between the p tags.
Upvotes: 0
Views: 3317
Reputation: 2622
This code. you need:
var x = '<p> </p>';
x.replace(/<p>( )+<\/p>/i, '');
Upvotes: 1