怎么用正则表达式快速批量替换如下内容
owner=AABowner=AACowner=ABCowner=BACowner=CDA替换为150.1.1={owner=AAB}150.1.1={owner=AAC...
owner = AAB
owner = AAC
owner = ABC
owner = BAC
owner = CDA
替换为
150.1.1 = { owner = AAB }
150.1.1 = { owner = AAC }
150.1.1 = { owner = ABC }
150.1.1 = { owner = BAC }
150.1.1 = { owner = CDA } 展开
owner = AAC
owner = ABC
owner = BAC
owner = CDA
替换为
150.1.1 = { owner = AAB }
150.1.1 = { owner = AAC }
150.1.1 = { owner = ABC }
150.1.1 = { owner = BAC }
150.1.1 = { owner = CDA } 展开
2个回答
展开全部
代码如下:
var str = '<ul><li>第一页</li><li class="">第二页</li> </ul>';
var str1 = str.replace(/href=".*?"/g,"");
console.log(str1);
var str = '<ul><li>第一页</li><li class="">第二页</li> </ul>';
var str1 = str.replace(/href=".*?"/g,"");
console.log(str1);
追问
请问一下,由于我是用notepad++文件来替换,因此 “查找目标(正则表达式)” 和 “替换为” 只能各写一行。但你这儿分了一二页,请问我这种情况查找目标里该怎么写?
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询