1

我正在寻找一个 JavaScript 正则表达式,它允许我删除括号中的任何文本并包含括号本身。

例子:

"hello world ( some Text and Number here)" 

我想修剪( some Text and Number here)并得到结果:

"hello world"
4

1 回答 1

2

你试过这个:

\(.*?\)

实际的js可能像dis:

var a = "hello world ( someText and Number here)";
a = a.replace(/\(.*?\)/, "");
于 2013-03-06T06:05:33.697 回答