$megatools --string-escape --client-side
String & Regex Escaper / Unescaper
Escape and unescape strings for JSON, JavaScript, SQL, Regular Expressions, Shell, and HTML.
Hello \"World\"!\nSpecial characters: $VAR, [0-9]+, 'O'Connor' & <tag>
Escape and unescape strings for JSON, JavaScript, SQL, Regular Expressions, Shell, and HTML.
Hello \"World\"!\nSpecial characters: $VAR, [0-9]+, 'O'Connor' & <tag>