mirror of
https://github.com/gchq/CyberChef
synced 2025-01-07 18:18:47 +00:00
Fix regex to handle multiple escaped backslashes
This commit is contained in:
parent
f9354c8cd1
commit
cbcc2aa731
1 changed files with 1 additions and 1 deletions
|
@ -836,7 +836,7 @@ class Utils {
|
|||
args = m[2]
|
||||
.replace(/"/g, '\\"') // Escape double quotes
|
||||
.replace(/(^|,|{|:)'/g, '$1"') // Replace opening ' with "
|
||||
.replace(/([^\\]|[^\\]\\\\)'(,|:|}|$)/g, '$1"$2') // Replace closing ' with "
|
||||
.replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g, '$1"$2') // Replace closing ' with "
|
||||
.replace(/\\'/g, "'"); // Unescape single quotes
|
||||
args = "[" + args + "]";
|
||||
|
||||
|
|
Loading…
Reference in a new issue