I try to create a regex for nr. of decimal of a number and the number of decimal will be pass from variable.
(Ex: 123.4545)-> 4decimals
const regex = 4;
const decimalValidation = helpers.regex('decimalValidation',/^\d*(\.\d{1,4})?$/); //Insted of 4 ,I have to replace with regex const.