I would like to convert a html code into text by using regexr. I am a beginner and I don't really know how to do it with split() and replace()...
For example:
const = myArtcle {
article: <p class="some-style">Some text with 094blabla.</p>
<img src="#" /><p class="style"> etc...</p>.
}
I tried this:
const textArticle = myArticle.article;
const deleteHTML = new RegExp(/\<(.*?)\>/);
const parsingText = () => {
textArticle.split(deleteHTML, '');
return (textArticle);
}
And I would like to have a parahraph:
Some text with 094blabla. etc...
instead of the html tags with the paragraph (so I want to remove all the html tags and only get the paragraph)
I would like to do it with RegExr
and function JavaScript only.