I have string like this:
<p>Dignissimos quo nostrum enim quo necessitatibus consequatur sed voluptatem. Provident aut dolorum voluptas qui. Veniam molestiae perspiciatis aspernatur quod. Labore maxime ipsa ab nesciunt. Dignissimos quo nostrum enim quo necessitatibus consequatur sed voluptatem. Provident aut dolorum voluptas qui. Veniam molestiae perspiciatis aspernatur quod. Labore maxime ipsa ab nesciunt.</p>
<p>Dignissimos quo nostrum enim quo necessitatibus consequatur sed voluptatem. Provident aut dolorum voluptas qui. Veniam molestiae perspiciatis aspernatur quod. Labore maxime ipsa ab nesciunt. Dignissimos quo nostrum enim quo necessitatibus consequatur sed voluptatem. Provident aut dolorum voluptas qui. Veniam molestiae perspiciatis aspernatur quod. Labore maxime ipsa ab nesciunt.</p>
I want to remove the HTML Tags and whitespace using regex then get the length.
I have already tried this:
this.text.replace(/(<([^>]+)>)/ig, ''); //This is just remove the HTML Tags
and this remove the whitespace:
this.text.replace(/\s/g, "")
I don't know how to combine the regex to remove the HTML tags and whitespace :(
/<[^>]+>|\s+/g