如果在括号之间,我如何使用 JS 正则表达式用单词 SPACE 替换所有出现的空格?所以,我想要的是这样的:
myString = "a scentence (another scentence between brackets)"
myReplacedString = myString.replace(/*some regex*/)
//myReplacedString is now "a scentence (anotherSPACEscentenceSPACEbetweenSPACEbrackets)"
编辑:我试过的是这个(我对正则表达式很陌生)
myReplacedString = myString.replace(/\(\s\)/, "SPACE");