JSFiddle - React, Tailwind, and code Playground
JavaScript
var str = "A word, <a href='#' title=''>words within tags should remain intact</a>, so here's"
+ " <b>even more</b> <u>words</u>";
var res = str.match(/(?:<(\w+)[^>]*>(?:[\w+]+(?:(?!<).*?)<\/\1>?)[^\s\w]?|[^\s]+)/g);
console.log(res);