I wanna add HTML tags around a markup [x,y] with x and y change may vary. I try to use some Regex to get these texts but i don't have the desired result.
I use this proposition : Insert HTML into text node with JavaScript
In my page, there is
[x,y] markup who x and y are number between -99 and 99
This markup is write manually in a text editor and be part of content for an article related to a video game and there may be multiple markups in the same page.
So I need to replace all
[x,y] to <em class="position">[x,y]</em>
I try these regex :
\[(.*?)\] (but add only <em> on . in the page)
\[0-9+\] (but add one <em> for each number in [x,y])
The objective is allow user to click on these elements to copy it to clipboard. (this second part works fine)
Anyone can help me ? :)

<element ... ></element>? 3) if the markup does vary, can you please provide some more markup example code ... maybe some markup that really differs from each other?textlooks like this ...[10,24] or [14,-25] or [x,y].., will the replacement be 3-times<em class="position">[x,y]</em>?