Regex with variables in it
This question already has an answer here:
这是你如何从字符串建立一个新的正则表达式:
var v = '[A-Za-z0-9]';
var regExp = new RegExp('^(' + v + '){1,8}$');
console.log(regExp);
链接地址: http://www.djcxy.com/p/76842.html
下一篇: 带有变量的正则表达式