I am trying to change brackets around numbers to parentheses.
I have used both Find & Replace and Replace Example.
I believe I have the correct regex to select the bracket, but when I replace them, I get a double parentheses on either side of the number.
 becomes ( )12( )
Here’s my code:
// define regex to use... const findRegex = /\[|\]/g; // define replacement expression... const replaceWith = "( )"; // do the replacement... draft.content = draft.content.replace(findRegex, replaceWith); draft.update();
Any suggestions on what I am doing wrong, please?