const detailFontSize = fontSize ? fontSize.replace(/(\d+)/, $1-2) : '';
For example, fontSize is "12pt", and I hope to modify it to "10pt". How to make the number operation in replace function with $1?
Codes above do not work since $1 is not defined. and if I add quotes, it will become to "12-2pt"