是否可以改变
Hello, this is Mike (example)
到
Hello, this is Mike
将 JavaScript 与正则表达式一起使用?
最佳答案
"Hello, this is Mike (example)".replace(/ *\([^)]*\) */g, "");
结果:
"Hello, this is Mike"
关于JavaScript/正则表达式 : Remove text between parentheses,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4292468/