第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如果替換具有$',則replace方法會產(chǎn)生意外結(jié)果

如果替換具有$',則replace方法會產(chǎn)生意外結(jié)果

不負相思意 2021-05-16 12:13:09
當替換字符串包含$'個字符時,請用奇怪的字符串替換方法結(jié)果。示例:https://jsfiddle.net/1jns2eo9/var p = 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?';var regex = /dog/gi;document.getElementById('first').innerHTML = p.replace(regex, '$');/// The quick brown fox jumps over the lazy $. If the $ reacted, was it really lazy?document.getElementById('second').innerHTML = p.replace(regex, "$'");/// The quick brown fox jumps over the lazy . If the dog reacted, was it really lazy?. If the reacted, was it really lazy? reacted, was it really lazy?
查看完整描述

2 回答

?
郎朗坤

TA貢獻1921條經(jīng)驗 獲得超9個贊

你應該逃避角色

replace(regex, "\$")

替換目標中的$具有特殊含義:將匹配組放入字符串中


查看完整回答
反對 回復 2021-05-27
  • 2 回答
  • 0 關注
  • 163 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號