簡體   English   中英

其中的括號和字符串的正則表達式

[英]regular expression for brackets and strings inside it

I am looking for a JavaScript regular expression that allow me to remove any text in brackets and include the brackets itself.

Example:

"hello world ( some Text and Number here)" 

And I want to trim ( some Text and Number here) and get the result as:

"hello world"

您是否嘗試過以下一種方法:

\(.*?\)

實際的js可能像dis:

var a = "hello world ( someText and Number here)";
a = a.replace(/\(.*?\)/, "");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM