javascript pattern replacement using backreference is not working
string.replace(/([\开发者_如何学Pythont])/g,"\\$1")
is working fine where
string.replace(/([\n])/g,"\\$1")
is not working!!!
any idea please???
N.B.
string.replace(/\n/g,"\\\n")
is also working fine
Use a script to capture the enter keypress event and replace it with '\' prior to submission.
精彩评论