正則表達(dá)式在線測(cè)試工具
更新時(shí)間:2008年10月19日 23:29:34 作者:
夢(mèng)遲在線測(cè)試正則表達(dá)式
復(fù)制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/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="wangorg(at)gmail.com,夢(mèng)遲" />
<meta name="Copyright" content="mengchi.cn,轉(zhuǎn)載請(qǐng)注明出處,作者夢(mèng)遲原創(chuàng)。" />
<meta name="description" content="閑來(lái)無(wú)事,做了個(gè)測(cè)試正則表達(dá)式的工具,轉(zhuǎn)載請(qǐng)注明出處." />
<meta content="夢(mèng)遲,在線測(cè)試,正則表達(dá)式,mengchi,正則,工具" />
<title>在線測(cè)試正則表達(dá)式工具-夢(mèng)遲出品</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="匹配結(jié)果: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="匹配結(jié)果:"+(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部代碼開始,作者夢(mèng)遲(mengchi.cn)轉(zhuǎn)載請(qǐng)注明出處-->
<body>
<p>正則表達(dá)式:</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>處理數(shù)據(jù):</p>
<p>
<textarea name="mc2" cols="88" rows="10" id="mc2" onblur="mengchi();"></textarea>
</p>
<p>處理結(jié)果:</p>
<p>
<textarea name="mc3" cols="88" rows="10" id="mc3" onblur="mengchi();"></textarea>
</p>
<p>
<span id="pipei"></span>
</p>
</body>
</html>
在線測(cè)試 http://www.dbjr.com.cn/tools/zhengze.htm
在線工具2 http://tools.jb51.net/tools/regex.asp
相關(guān)文章
js正則表達(dá)式中的單行模式與多行模式實(shí)例分析
這篇文章主要介紹了js正則表達(dá)式中的單行模式與多行模式,實(shí)例分析了js正則表達(dá)式中實(shí)現(xiàn)單行模式與多行模式的技巧,需要的朋友可以參考下2015-01-01正則表達(dá)式中問(wèn)號(hào)(?)的正確用法詳解
本文主要介紹了正則表達(dá)式中問(wèn)號(hào)(?)的正確用法詳解,主要介紹了4種用法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2022-05-05正則表達(dá)式匹配0-10的正整數(shù)以及使用細(xì)節(jié)
我們可以使用正則表達(dá)式來(lái)代表一些我們希望的字符串類型,比如正整數(shù),下面這篇文章主要給大家介紹了關(guān)于正則表達(dá)式匹配0-10的正整數(shù)以及使用細(xì)節(jié)的相關(guān)資料,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-11-11詳解Java判斷是否是整數(shù),小數(shù)或?qū)崝?shù)的正則表達(dá)式
這篇文章主要介紹了詳解Java判斷是否是整數(shù),小數(shù)或?qū)崝?shù)的正則表達(dá)式,非常具有實(shí)用價(jià)值,需要的朋友可以參考下。2016-12-12java 正則表達(dá)式基礎(chǔ),實(shí)例學(xué)習(xí)資料收集大全
本站長(zhǎng)期收集的java正則表達(dá)式學(xué)習(xí)資料,包括javascript,vbscript,asp,php,asp.net等正則表達(dá)式學(xué)習(xí)資料2007-12-12Android中手機(jī)號(hào)、車牌號(hào)正則表達(dá)式大全
這篇文章主要介紹了Android中手機(jī)號(hào)、車牌號(hào)正則表達(dá)式的相關(guān)資料,需要的朋友可以參考下2015-09-09