I am using CSV file for providing data to my tests written in webdriverIO. While reading regex commas are not read by csv file, so i am adding '&' in csv file for regex e.g : ^[0-9]{8&15}$ and then replacing '&' with ',' (comma) to make regex some like this ^[0-9]{8,15}$ but the problem is while reading this in script the {8,15} which is min and max number are not getting formed as needed. Its generating regexps something like 2{8,15}, 5{8,15} .. and so on.
I am replacing '&' with ',' using method below:
randomExpression(exp) {
return new RandExp(exp).gen();
}
modifyRegEx(regex){
const rgx = this.randomExpression(regex)
return rgx.replace(/&/g, ',');
}
I tried finding ways but could not find anything, is this issue with curly braces? How to make this string recognized as regex?