I need to break a line like this
<p>foo</p><p>bar</p>
into an array with "foo" and "bar"
I thought RegEx might help me, but it seems I did not understand RegEx. This is my attempt.
var inputText = "<p>foo</p><p>bar</p>";
splittedSelection = inputText.split("/<p>|<\/p>/g");
But all I can achieve is a single record array, and this is the same as inputText.
I made a little violin for you.
Thanks for any help.
source
share