当前位置: 代码迷 >> JavaScript >> 伸手党求正则解决思路
  详细解决方案

伸手党求正则解决思路

热度:63   发布时间:2012-06-19 14:45:20.0
伸手党求正则
如何将 "i.ID=aoofe&i.Name=FOOFE&i.Age=100&i.Text=Ai.tode&i.Tag=foooottt"
替换成 "ID=aoofe&Name=FOOFE&Age=100&Text=Ai.tode&Tag=foooottt"


------解决方案--------------------
JScript code

var s = 'i.ID=aoofe&i.Name=FOOFE&i.Age=100&i.Text=Ai.tode&i.Tag=foooottt';
var r = /(&|^)i./g;
alert(s+'\r\n'+s.replace(r,'$1')); 
  相关解决方案