- This is a really long line, and should be broken into several that aren'tquite so long (probably at the `.`s after `replace`)
- What does `\\\'..` match? Is there a way the `.`s can be more specific?
- `(\{.*\})?` probably doesn't do what you want. What case are you trying to handle here? I think `\{.*\}` will match from the next open bracket to the last close bracket in the document because `*` is greedy, which could be bad. It's impossible to match what's inside the  brackets properly, since JavaScript doesn't support recursive regexps. `\{[^}]*\}` will match from the next open bracket to the next close bracket, but this might actually end up generating an invalid RTF document if there's another open bracket before the next close bracket, which would also be bad.