Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- js = Regex.Replace(js, "(?<='[^'\n]*)(?<!\\\\)(\"|\\\\')(?=[^'\n]*')", "\\\""); //escape all nested "
- js = Regex.Replace(js, "'(?=([^'\n]*((?<=\\\\)\")?[^'\n]*'))", "\""); //replace first ' by " when next symbols contains \", and ' at the end
- js = Regex.Replace(js, "(?<=(\\\"[^'\n]*((?<=\\\\)\")?[^'\n]*))'", "\""); //replace last ' when prev symbols contains escaped ", and ' at the start
- js = Regex.Replace(js, "(?<=\".*)\\\\\"(?=.*\")", "'"); //replace all \" by ' that located between " "
- js = Regex.Replace(js, "(?<=`[^`\n]*)(?<!\\\\)\"(?=[^`\n]*`)", "\\\""); //escape all nested "
- js = Regex.Replace(js, "`(?=([^`\n]*((?<=\\\\)\")?[^`\n]*`))", "\""); //replace first ' by " when next symbols contains \", and ' at the end
- js = Regex.Replace(js, "(?<=(\\\"[^`\n]*((?<=\\\\)\")?[^`\n]*))`", "\""); //replace last ' when next symbols contains escaped ", and ' at the start
- js = Regex.Replace(js, "(?<=\".*)\\\\\"(?=.*\")", "'"); //replace all \" by ' that located between " "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement