Im trying to run a very basic Google Script on a document. docBody = docBody.replaceText(searchStr, replaceStr);
It works perfectly when the searchStr = 'Name' for example, but when I try to replace '[Name]' the script hangs and produces garbage in the document. I realise that the searchStr parameter is a regular expression and I have tried :
\[Name\]
/\[Name\]/g
(\[Name\])
All with no success...
Any suggestions?