This question has already been answered:

Problems with regular expressions.
Hello, as in the text of the replace screen (change everything " to \" )

and how to change everything \ to \\\ (triple)

thank!

Reported as a duplicate by participants in Visman , Kromster , user194374, Denis , Dmitriy Simushev Jul 21 '16 at 13:20 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • why exactly triple? - Grundy
  • so it is necessary to transfer the text - SerikStartAndroid
  • five
    This is probably a duplicate for .stackoverflow.com / questions/545191 / - Visman
  • @Visman only there the answer is not very. - Nick Volynkin
  • Viseman agree - SerikStartAndroid

1 answer 1

 function(s) { return s.replace(/["\\]/g, '\\$&'); };