簡體   English   中英

如何使用 jQuery 用 RegEx 替換 ()

[英]How to replace () with RegEx using jQuery

這是我的正則表達式:

console.log(test.replace(/0098/g, ")").replace(/[()]/g, ''));

如果存在,如何僅替換()

我的代碼現在替換了所有橋接器。 我只想替換 where is exists ()

就像我的例子:

var test = "(test1234) - test948 () usi27361() 928372da";

新字符串: (test1234) - test948 usi27361 928372da

 var str = "(test1234) - test948 () usi27361() 928372da"; console.log(str.replace(/\\(\\)/g, ""));

暫無
暫無

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

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