把下面代码复制到记事本里,保存为 HTML 格式就ok 了!
原代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0045)http://guoxin.lai.googlepages.com/sch_rpl.htm -->
<!-- copywrite by alai http://www.9499.net All rights reserve--><HTML><HEAD><TITLE>Power Maintenance Tools -- By Alai [http://www.9499.net]</TITLE>
<META http-equiv=Content-Type content=text/html;charset=gb_2312-80>
<META content="MSHTML 6.00.3790.2759" name=GENERATOR></HEAD>
<BODY>
<DIV
style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; WIDTH: 700px; TEXT-ALIGN: center">高级查找/替换、正则表达式练习器、Javascript脚本程序调试器<BR><TEXTAREA id=text1 rows=18 cols=90></TEXTAREA><BR><SPAN
id=spanFirst>查询表达式</SPAN>:<INPUT id=txtFirst size=60><BR><SPAN
id=spanSecond>替换为</SPAN>:<INPUT id=txtSecond size=56><BR><INPUT id=chkLineMode
type=checkbox value=false>行模式运行 <INPUT id=btnExe type=button value=运行脚本程序> <INPUT id=btnSchRpl type=button value=执行查找/替换> <INPUT id=btnUndo disabled type=button value=撤消> <INPUT id=btnRedo disabled type=button value=重做> <BR></DIV>
<SCRIPT>
var aryUndo=[],aryRedo=[]
function btnExe.onclick()
{
if(text1.value=="")return false
if(!chkLineMode.checked)
{try{
eval(text1.value);
}
catch(e)
{
var msg=e.number+"\n"
msg+=e.description+"\n"
alert(msg)
}
return
}
aryCommand=text1.value.split("\r\n")
var line
try{
for(line=0;line<=aryCommand.length-1;line++)
{
eval(aryCommand[line]+";")
}
}
catch(e){
var msg="执行脚本程序程序出错,在第"+(line+1)+"行。\n"
msg+="错误代码:"+e.number+"\n"
msg+="错误信息:"+e.description+"\n"
alert(msg)
}
}
function btnSchRpl.onclick()
{
if(txtFirst.value=="")
{
alert("请输入查询条件!")
txtSecond.focus()
return false
}
aryUndo[aryUndo.length]=text1.value
aryRedo=[]
btnRedo.disabled=true
btnUndo.disabled=false
var s=new RegExp(txtFirst.value,"ig")
text1.value=text1.value.replace(s,txtSecond.value)
}
function btnUndo.onclick()
{
aryRedo[aryRedo.length]=text1.value
btnRedo.disabled=false
text1.value =aryUndo[aryUndo.length-1]
aryUndo.length--
if(aryUndo.length==0)btnUndo.disabled=true
}
function btnRedo.onclick()
{
aryUndo[aryUndo.length]=text1.value
btnUndo.disabled=false
text1.value=aryRedo[aryRedo.length-1]
aryRedo.length--
if(aryRedo.length==0)btnRedo.disabled=true
}
</SCRIPT>
<BR>
<DIV style="WIDTH: 100%; TEXT-ALIGN: center">power by Alai <A
href="http://www.9499.net/">http://www.9499.net/</A></DIV></BODY></HTML>