此代码中的模式不会替换括号。我也试过“/(|)/ g”。Javascript替换不会替换
var re = "/[^a-z]/g",
txt = navsel.options[i].text.split(" ")[0], // here I get the text from a select and I split it.
// What I expect is strings like "(en)" , "(el)" etc
txt = txt.replace(re," ")
在此先感谢
什么是你输入的文字和你有什么期望的输出是什么? –
编辑,对不起,我没有指定 – chchrist