争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

正则表达式练习器

时间:2024/6/29作者:未知来源:争怎路由网人气:

! form.scankmode.checked) {
findIt(form)
form.reglist.value = ""
}
var key = true
if(form.scankmode.checked) key = false
do {
var input = form.main.value
var matchArray = re.exec(input.substr(nextpoint))
if(matchArray) {
for(var i=1;i<matchArray.length;i++)
matchArray[i] = "$"+i+":"+matchArray[i]
form.reglist.value = (nextpoint+matchArray.index)+" => " + matchArray[0] +"\n"+form.reglist.value
form.matchlist.value = "$0:"+matchArray.join("\n")
nextpoint = nextpoint + matchArray.index + matchArray[0].length
}else {
if(!key)
form.reglist.value = "没有找到\n" + form.reglist.value
form.matchlist.value = " "
nextpoint = 0
key = false
}
}while (key)
}
//设置当前使用的正则表达式
function setregexp(n) {
var s = document.all.regexplist.value.split("\r\n")
document.all.regexp.value = s[n*2-1] //.replace("\r","")
nextpoint = 0
}

//定义选择监视
var isNav = (navigator.appName == "Netscape")
function showSelection() {
if (isNav) {
var theText = document.getSelection()
} else {
var theText = document.selection.createRange().text
}
if(theText.length>0 && document.all.selechkmode.checked)
document.all.regexp.value = theText
}
if (isNav) {
document.captureEvents(Event.MOUSEUP)
}
document.onmouseup = showSelection
</SCRIPT>

</HEAD>
<BODY style="font-size=9pt;" OnMouseMove=OnMove()>
<FORM><table width=100% cellspacing=0 cellpadding=0><tr><td><font color=red>正规表达式练习器</font></td><td align=right><a href=mailto:czjsz_ah@stats.gov.cn>czjsz_ah@stats.gov.cn</a></td></tr>
<table width=100% broder=1 frame=above rules=none style="font-size:9pt;">
<tr><td width=50% valign=top>
输入一些被寻找的正文:<BR>
<TEXTAREA NAME="main" COLS=58 ROWS=5 WRAP="virtual" style="font-size:9pt;">
09-11-2001 09/11/2001 czjsz_ah@stats.gov.cn
asdff 12345 196.168.1.3 www.sohu.com ftp://www.chinaasp.com 2001.9.11 http://www.active.com.cn/club/bbs/bbsView.asp http://www.163.com/inden.htm
</TEXTAREA><BR>
进行匹配的正规表达式:  忽略大小写<INPUT TYPE="checkbox" NAME="chkmode" checked style="font-size:8pt;height:18px"><BR>
<TEXTAREA NAME="regexp" COLS=51 ROWS=5 style="font-size:9pt;"></TEXTAREA>
<INPUT TYPE="button" VALUE="清除" onClick="this.form.regexp.value=''" style="font-size:8pt;height:18px"><BR>
<INPUT TYPE="button" VALUE="能找到吗?[regexObject.test(string)]" style="font-size:8pt;width:70%;height:18px" onClick="findIt(this.form)">
<INPUT TYPE="radio" NAME="output" style="font-size:8pt;height:18px">Yes
<INPUT TYPE="radio" NAME="output" style="font-size:8pt;height:18px">No <BR>
<INPUT TYPE="button" VALUE="在哪里?[string.search(regexObject)]" style="font-size:8pt;width:70%;height:18px" onClick="locateIt(this.form)">
<INPUT TYPE="text" NAME="offset" SIZE=4 style="font-size:8pt;height:18px">
</td>
<td valign=top>
测试用正则表达式列表: 
使用第<input type=text name=num size=2 value=1 style="font-size:8pt;height:18px">个<input type=button value=Go onClick=setregexp(this.form.num.value) style="font-size:8pt;height:18px">
    允许复制<INPUT TYPE="checkbox" NAME="selechkmode" style="font-size:8pt;height:18px">
<textarea NAME="regexplist" cols=58 rows=14 wrap=off style="font-size:9pt;">
1.检查日期:
(1[0-2]

关键词:正则表达式练习器




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版