I have a regular expression as below:
var myVar = "some text";
var decimal = /^\s*(\+|-)?((\d+(\,\d+)?)|(\,\d+))\s*$/;
How to concat it with the myVar variable which is a string?
I tried the below but didn't work:
var decimal = new RegExp("/^\s*(\+|-)?((\d+(\" + myVar + "\d+)?)|(\" + myVar + "\d+))\s*$/");
1,23in one locale and1.23in another? I'd suggest using some i18n library like this or this.