var seperator = ',', group = 'red, blue';
//group.search(seperator/g) - g is not defined
group.search(/seperator/g) // looks for "seperator"
group.search('/' + seperator + '/g') // doesn't seem to find my "seperator"
並且由於我的想法...我如何在表達式中獲得我的seperator
?可變內部模式
在此先感謝!
[stackoverflow.com/search?q=javascript+regular+expression+from+variable](http://stackoverflow.com/search?q=javascript + regular + expression + from + variable) – user113716