正则表达式在线测试工具
发布时间:2020-04-07 来源:未知 点击:
次
复制代码 代码如下:
在线测试正则表达式工具-梦迟出品function mengchi(){
var a=document.getElementById("mc1").value;
var b=document.getElementById("mc2").value;
var c=new RegExp(a,"g");
document.getElementById("mc3").value="";
pipei.innerHTML="匹配结果:0";
var arrMactches = b.match(c);
for (var i=0;i < arrMactches.length ; i++){
if (a!=""){
ee=document.getElementById("mc3").value+"\n"+arrMactches[i];
document.getElementById("mc3").value=ee;
pipei.innerHTML="匹配结果:"+(i+1);
}
}
document.getElementById("mc3").value=document.getElementById("mc3").value.replace("\r\n","");
}
function charu (text) {
document.all.mc1.focus();
event.srcElement.document.selection.createRange().text += text;
document.all.mc1.blur();
}
function qingchu () {
document.getElementById("mc1").value="";
}
正则表达式:
处理数据:
处理结果:
在线测试 //www.jb51.net/tools/zhengze.htm
在线工具2 http://tools.jb51.net/tools/regex.asp
这就是微学网-程序员之家为你提供的"正则表达式在线测试工具"希望对你有所帮助.本文来自网络,转载请注明出处:http://www.weixuecn.cn/article/13060.html