I was wondering if there is any way that I can replace substrings within a string but alternate between the string to replace them with. I.E, match all occurences of the string "**"
and replace the first occurence with "<strong>"
and the next occurence with "</strong>"
(And then repeat that pattern).
The input would be something like this: "This is a sentence with **multiple** strong tags which will be **strong** upon output"
And the output returned would be: "This is a sentence with <strong>multiple</strong> strong tags which will be <strong>strong</strong> upon output"