EZ
L@_@K
<!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">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<script type="text/javascript">
<!--
var str = "idUsers=0;otherSize=0;seizeUsers=0;totalUsers=100";
// need: otherSize=0和totalUsers=100
var re = /(otherSize=\d+).*(totalUsers=\d+)/g;
var arr = re.exec(str);
document.write("I wanted: ", RegExp.$1, " and ", RegExp.$2);
//-->
</script>
</body>
</html>
L@_@K
<!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">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<script type="text/javascript">
<!--
var str = "idUsers=0;otherSize=0;seizeUsers=0;totalUsers=100";
// need: otherSize=0和totalUsers=100
var re = /(otherSize=\d+).*(totalUsers=\d+)/g;
var arr = re.exec(str);
document.write("I wanted: ", RegExp.$1, " and ", RegExp.$2);
//-->
</script>
</body>
</html>
在页面上显示为这样:其他范围:0 统计用户:100(是通过otherSize=0,totalUsers=100 得到,冒号后面的值是从等会后面的值获得)在页面上还要怎么写?
<script type="text/javascript">
var str=mystr.innerHTML;
var myarry=str.split(";")
mystr.innerHTML=myarry[1]+" 和 "+myarry[3]
</script>
<script type="text/javascript">
var str=mystr.innerHTML;
var myarry=str.split(";")
mystr.innerHTML=myarry[1].replace("otherSize=","其他范围:")+" "+myarry[3].replace("totalUsers=","统计用户:")
</script>