为BBS增加的解析函数, 不增增加的解析函数, 不增增它BBS的JS代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<헤드>
<TITLE>BBS </TITLE>
<META NAME="생성기" CONTENT="EditPlus">
<META NAME="저자" CONTENT="">
<META NAME="키워드" CONTENT="">
<META NAME="설명" 내용="">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<SCRIPT LANGUAGE="자바스크립트">
<!--
함수 인쇄(str) {
var matchPIC = new RegExp("((?:http|https|ftp|mms|rtsp)://(&(?=amp;)|[A-Za-z0- 9./=?%_~@#:;+-])+(gif|jpg|png))", "ig");
var matchURL = new RegExp("((?:http|https|ftp|mms|rtsp)://(&(?=amp;)|[A-Za-z0-9./=?%_~ @&#:;+-])+)","ig");
var str2 ="";
str2 =str.replace(" "," ")
if(matchPIC.test(str)){
document.write(str2.replace(matchPIC, "<img src="$1" 힌트="$1"></img>"));
}또 다른{
document.write(str2.replace(matchURL, "<a target="_blank" href="$1">$1</a>"));
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="자바스크립트">
<!--
var str = " var str2 = " var str3 = " http://www.csdn.net ";
document.write("<BR>str为"+str+"<BR>관리자:<BR>");
인쇄(str);
str = "";
document.write("<BR>str2为"+str2+"<BR>관리자:<BR>");
인쇄(str2);
str2= "";
document.write("<BR>str3为"+str3+"<BR>관리자:<BR>");
인쇄(str3);
//-->
</SCRIPT>
</BODY>
</HTML>