梅 雪 香
梅须逊雪三分白
雪却输梅一段香
语源科技BlogJava
首页
新随笔
联系
聚合
管理
随笔 - 16 文章 - 42 trackbacks - 0
<
2012年12月
>
日
一
二
三
四
五
六
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
失业中…
常用链接
我的随笔
我的评论
我的参与
最新评论
留言簿
(7)
给我留言
查看公开留言
查看私人留言
随笔档案
(16)
2017年10月 (1)
2011年10月 (1)
2009年9月 (1)
2009年4月 (1)
2009年3月 (1)
2007年9月 (1)
2007年6月 (2)
2006年11月 (1)
2006年10月 (3)
2006年9月 (4)
技术Blog
Danger's Blog
flash actionscript
EMU's BLOG@blogjava.net
farproc's blog
jayson@phpchina.com
JK.spaces.live.com/
KingDa's Blog
flash actionscript 黑羽翔天
twinsenliang.net
yanwl's blog@csdn
嗷嗷.com
梅花雪@CSDN
搜索
最新随笔
1. How To Set Up an OpenVPN Server on Ubuntu 14.04
2. 基于jQuery的简单的模板方法
3. [转]windows 下浏览器和操作系统的 DNS cache
4. 搭建javascript开发环境
5. JavaScript像什么?
6. 正则表达式兼文本处理器3.0 Windows Hosts文件编辑器3.2 下载
7. 3种基本的Flash/Javascript通信方式
8. Ajax简易开发框架
9. 译:DOM2中的高级事件处理
10. 译:函数作用域与闭包
最新评论
1. re: 正则表达式兼文本处理器3.0 Windows Hosts文件编辑器3.2 下载[未登录]
评论内容较长,点击标题查看
--梅雪香
2. re: 正则表达式兼文本处理器3.0 Windows Hosts文件编辑器3.2 下载[未登录]
小梅,支持IE10不?
--jl
3. re: 正则练习兼文本处理器 2.0第三方
撒旦法斯蒂芬斯蒂芬
--地方dfdd
4. re: JavaScript像什么?
楼主 磨叽
受不了
建议你看看 川藏旅游的游记, 对你的思想品味肯定有帮助
--爱情
5. re: 译:DOM2中的高级事件处理
@爱情
这个好普通啊, 我觉得
觉得 作者说的内容 太普通了
--爱情
阅读排行榜
1. 全排列算法的递归与非递归实现(11270)
2. 3种基本的Flash/Javascript通信方式(6232)
3. DES算法的javascript实现(5595)
4. 译:DOM2中的高级事件处理(3732)
5. 常用公历日期处理程序(3252)
评论排行榜
1. 正则表达式兼文本处理器3.0 Windows Hosts文件编辑器3.2 下载(10)
2. 全排列算法的递归与非递归实现(8)
3. 译:DOM2中的高级事件处理(7)
4. DES算法的javascript实现(4)
5. 根据汉字返回拼音首字母字符串(3)
正则练习兼文本处理器 2.0
正则练习兼文本处理器 2.0
<
html
>
<
head
>
<
meta http
-
equiv
=
"
Content-Type
"
content
=
"
text/html; charset=gb2312
"
>
<
title
>
梅雪香
--
正则练习兼文本处理器
2.0
</
title
>
<
style type
=
"
text/css
"
>
#divMain
{width:
100
%
; text
-
align:center;}
#tbVector
{width:800px; height:500px; font
-
size:12px; border:1px solid #CC9900; margin
-
bottom:4px;}
#tbVector td
{border:1px solid #CC9900; width:
50
%
; }
textarea
{
width:
100
%
;
height:
100
%
;
background
-
color:#CCFFCC ;
scrollbar
-
highlight
-
color: #CCCC99;
scrollbar
-
shadow
-
color: #8C9EB7;
scrollbar
-
3dlight
-
color: #B0C4D8;
scrollbar
-
track
-
color: #CCCC88;
scrollbar
-
Base
-
Color: #CCCC99;
}
#tr1,#tr3,#tr5
{height:25px; color:#FF0066; font
-
size:13px; font
-
weight: bold; cursor:
default
; }
#tr2
{height:40px;}
#tr1 td,#tr3 td
{ background
-
color:#FFCCFF }
#spRegTitle
{width:190px;}
#spOption
{width:100px;}
#spHisRecord
{width:60px; font
-
weight:
600
; cursor:hand; color:blue; text
-
align:right;}
#tr5
{background
-
color:FFFFEF}
#tr5 td
{text
-
align:center;}
#tr5 #tr5td2 input
{ width:60px; border:1px solid #66CCFF; background
-
color:#FF99CC}
#spSou,#spOut
{ width:280px; }
#spReadFromFile,#spWrToFile
{ color:blue; cursor:hand; }
#tbDollar
{width:800px; font
-
size:12px; border:1px solid #CC9900; cursor:
default
; margin
-
bottom:4px;}
#tdR1,#tdR2,#tdR3,#tdR4,#tdR5,#tdR6,#tdR7,#tdR8,#tdR9
{width:60px; text
-
align:center; vertical
-
align:middle; }
#tdD1,#tdD2,#tdD3,#tdD4,#tdD5,#tdD6,#tdD7,#tdD8,#tdD9
{width:207px; word
-
break
:
break
-
all; }
#tdR1,#tdR2,#tdR3,#tdD4,#tdD5,#tdD6,#tdR7,#tdR8,#tdR9
{ background
-
color:#BFD1D9; }
#tdD1,#tdD2,#tdD3,#tdR4,#tdR5,#tdR6,#tdD7,#tdD8,#tdD9
{ background
-
color:#D8C0D8; }
#divCopyRight
{ width:800px; height:30px; text
-
align:right; color:blue;font
-
size:12px; }
#divHisRecd
{ border:1px solid #CC9900; position:absolute; background
-
color:#D8C0D8;display:none; cursor:
default
; }
#divHisRecd div
{font
-
size:12px; margin:2px; }
.divList0
{background
-
color:#D8F7F8; }
.divList1
{background
-
color:#FEFEE7; }
.divListOver
{background
-
color:#FF9933; }
</
style
>
<
script language
=
"
JavaScript
"
>
<!--
/**/
/*
程序:正则练习兼文本处理器
*作者:梅雪香(meixx)
*日期:
*版本:2.0
*/
var
$
=
document.getElementById;
var
gFso
=
null
;
//
全局FileSystemObject对象
var
arHisRecd
=
[];
//
记录使用过的正则历史
var
lastStyle
=
""
;
//
获得对象的位置信息
function
getPosition(obj)
{
var
top
=
0
;
var
left
=
0
;
var
width
=
obj.offsetWidth;
var
height
=
obj.offsetHeight;
while
(obj.offsetParent)
{
top
+=
obj.offsetTop;
left
+=
obj.offsetLeft;
obj
=
obj.offsetParent;
}
return
{
"
top
"
:top,
"
left
"
:left,
"
width
"
:width,
"
height
"
:height}
;
}
//
全局初始化
function
init()
{
var
divHisRecd
=
$(
"
divHisRecd
"
);
var
o
=
getPosition($(
"
spHisRecord
"
));
with
(divHisRecd.style)
{
top
=
o.top
+
o.height;
left
=
o.left;
}
with
(divHisRecd)
{
attachEvent(
"
onselectstart
"
,
function
()
{event.returnValue
=
false
;}
);
attachEvent(
"
oncontextmenu
"
,
function
()
{event.returnValue
=
false
;}
);
}
$(
"
spWrToFile
"
).attachEvent(
"
onclick
"
,
function
()
{
fso
=
new
ActiveXObject(
"
Scripting.FileSystemObject
"
);
var
val
=
$(
"
filText
"
).value;
if
(val
==
""
)
return
;
var
ts
=
fso.OpenTextFile(val,
2
);
ts.write( $(
"
taOut
"
).value);
ts.close();
alert(
"
文件\n
"
+
val
+
"
\n替换并且保存成功!
"
);
}
);
$(
"
filText
"
).attachEvent(
"
onchange
"
,
function
()
{
gFso
=
new
ActiveXObject(
"
Scripting.FileSystemObject
"
);
var
val
=
$(
"
filText
"
).value;
var
file
=
gFso.GetFile(val);
var
ts
=
gFso.OpenTextFile(val,
1
);
$(
"
taSou
"
).value
=
(file.Size
>
0
?
ts.ReadAll():
""
);
ts.close();
}
);
document.onclick
=
function
()
{
switch
(event.srcElement.id)
{
case
"
spHisRecord
"
:
(
function
()
{
if
(arHisRecd.length)
divHisRecd.style.display
=
(divHisRecd.style.display
==
"
block
"
)
?
"
none
"
:
"
block
"
;
}
)();
break
;
case
"
btnTest
"
:
case
"
btnMatch
"
:
case
"
btnReplace
"
: