Build a dynamic regex with a variable
by sij /
I needed to build a dynamic regex, which consists of a variable.
var decimal_separator = ".";
var regex = new RegExp("[0-9]|\\" + decimal_separator);
I needed to build a dynamic regex, which consists of a variable.
var decimal_separator = ".";
var regex = new RegExp("[0-9]|\\" + decimal_separator);