I am trying to split a string by matching some patterns using regex,
for instance i have <span>Hello World</span>
and the result would be ["<span>", "Hello World", "</span>"]
// Tried this
console.log(arr.split(/(<*>)/));
// and this:
console.log(arr.split(/(^<$>)/));