gpt4 book ai didi

使用反向引用的 javascript 模式替换不起作用

转载 作者:行者123 更新时间:2023-11-28 10:28:10 25 4
gpt4 key购买 nike

string.replace(/([\t])/g,"\\$1")

在哪里工作正常

string.replace(/([\n])/g,"\\$1")

不工作!!!

请问有什么想法吗???

注意

string.replace(/\n/g,"\\\n")

也工作正常

最佳答案

使用脚本 capture the enter keypress event并在提交之前将其替换为“\”。

关于使用反向引用的 javascript 模式替换不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3829794/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com