I have this HTML line which often has many spaces
Example:
<p>All these words <br />
<strong>All</strong> <em>these</em> words
<pre> All these words</pre>
</p>
I need to remove them using JavaScript and come up with this regEx:
String.replace(/ {2,}/g, '');
Which seems to work with replacing unwanted spaces, but I want to keep spaces inside the PRE element.
Is this possible with regex?
pokemon
source
share