正则表达式在线测试工具
网络编程 2021-07-05 10:07www.168986.cn编程入门
梦迟在线测试正则表达式
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://.w3./1999/xhtml" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="author" content="wang(at)gmail.,梦迟" />
<meta name="Copyright" content="mengchi.,网络推广网站推广转载请注明出处,作者梦迟原创。" />
<meta name="description" content="闲来无事,做了个测试正则表达式的工具,网络推广网站推广转载请注明出处." />
<meta content="梦迟,在线测试,正则表达式,mengchi,正则,工具" />
<title>在线测试正则表达式工具-梦迟出品</title>
<script type="text/javascript">
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="";
}
</script>
</head>
<!--body部代码开始,作者梦迟(mengchi.)网络推广网站推广转载请注明出处-->
<body>
<p>正则表达式:</p>
<p>
<input name="mc1" type="text" id="mc1" size="88" onblur="mengchi();"/>
</p>
<p>
<input type="button" value="^" onclick="charu('^');">
<input type="button" value="[" onclick="charu('[');">
<input type="button" value="a-z" onclick="charu('a-z');">
<input type="button" value="0-9" onclick="charu('0-9');">
<input type="button" value="]" onclick="charu(']');">
<input type="button" value="+" onclick="charu('+');">
<input type="button" value="*" onclick="charu('*');">
<input type="button" value="?" onclick="charu('?');">
<input type="button" value="." onclick="charu('.');">
<input type="button" value="\" onclick="charu('\\');">
<input type="button" value="w" onclick="charu('w');">
<input type="button" value="b" onclick="charu('b');">
<input type="button" value="d" onclick="charu('d');">
<input type="button" value="f" onclick="charu('f');">
<input type="button" value="n" onclick="charu('n');">
<input type="button" value="{" onclick="charu('{');">
<input type="button" value="," onclick="charu(',');">
<input type="button" value="}" onclick="charu('}');">
<input type="button" value="$" onclick="charu('$');">
<input type="button" value="清除" onclick="qingchu();">
</p>
<p>处理数据:</p>
<p>
<textarea name="mc2" cols="88" rows="10" id="mc2" onblur="mengchi();"></textarea>
</p>
<p>处理结果:</p>
<p>
<textarea name="mc3" cols="88" rows="10" id="mc3" onblur="mengchi();"></textarea>
</p>
<p>
<span id="pipei"></span>
</p>
</body>
</html>
在线测试
在线工具2
上一篇:正则表达式提取网址、标题、图片等一例(.Net
下一篇:正则文本框只能输入正整数
编程语言
- 机械手焊接机器人编程 机械手焊接设备编程
- vb数据库编程实例,vb做数据库
- tiobe世界编程语言排行榜,全球编程语言排行
- 成都java编程培训 成都it编程培训中心
- 编程基础培训,编程基础知识培训
- flash游戏编程基础教程,flash游戏开发教程
- 不会英语能学编程吗 不会英语可以学程序员吗
- 爱心代码编程C语言 爱心代码编程c语言公式
- c语言编程学习入门 c语言编程快速入门
- 西门子plc编程培训 西门子plc编程培训班
- 哪里可以学编程 台州哪里可以学编程
- 少儿编程哪个好 少儿编程哪个品牌好
- 编程是什么意思,图形编程是什么意思
- c语言编程软件下载,c语言编程软件在哪下载
- java编程软件下载,java编程下载手机版
- ug编程培训学校,ug编程培训教程