我有包含转义和未转义正斜杠的字符串。
我正在寻找 sed 替换来仅转义未转义的斜杠,但似乎不支持负向后查找。
例子:
input: "https:\/\/github.com\/foo\/bar\/pull\/2934) is live at https://baz/test.com"
desired output: "https:\/\/github.com\/foo\/bar\/pull\/2934) is live at https:\/\/baz\/test.com"
Run Code Online (Sandbox Code Playgroud)