How can I use the JS regular expression to replace all occurrences of space with the word SPACE, if between brackets? So I want this:
myString = "a scentence (another scentence between brackets)"
myReplacedString = myString.replace(/*some regex*/)
//myReplacedString is now "a scentence (anotherSPACEscentenceSPACEbetweenSPACEbrackets)"
EDIT: what I tried this (I'm brand new to regexes)
myReplacedString = myString.replace(/\(\s\)/, "SPACE");
source
share