Something like the following is probably faster for long strings (i.e. only iterates string once)?

```escpae(String s) => s.replaceAllMapped(new RegExp(r'(\"|$|\n), (m) => "$\\m[1]);```