I have a consistent paragraph that I wanted to replace and I was having trouble getting InDesign scripting to cooperate. A simple GREP query that worked in InDesign, did not in scripting. After some trial and error, I found that simply escaping the slashes was what InDesign scripting needed. Posting for anyone trying to solve a similar problem, most likely me in a few years. 😄
Thanks! It also appears triple slashes work for the script as well:
Anything more than that and it stops working. It appears the first 2 are interpreted as a \ and the third escapes whatever follows? The sample provided doesn't scrub the find replace, so I tested a few different outcomes to see what it was parsing.