I’m no regex guru, so I split this into 4 separate pieces:
1 2 3 4 5 6 7 8 9 10 11
Return the replacement string and set it to the value you want to save. I wanted to use jQuery, so here’s the final product:
1 2 3 4 5 6
I have a containing div with the id “nn-results”, grab it’s inner html, do the replacements on that html, and then set the id=”copy-txt” input element value to be the results. I have seen some posts where people tried to make all that replacement happen in one regex, but I wasn’t good enough with the regex/js combo to make it work. If someone is ready to go pro, and it isn’t easy, please comment below.