pos1=mycode.indexOf("<")
pos2=mycode.indexOf(">")
mycode=mycode.substr(pos1,pos2)
pos2=mycode.indexOf(">")
mycode=mycode.substr(pos1,pos2)
解决方案 »
- 请高手帮看下这个JS什么意思 !谢谢!
- ""==0,这个表达式竟然返回 true,百思不得其解呀?
- javascript调用cmd.exe,错误提示,Automation 服务器不能创建对象
- 请问select选定的问题?
- document write方法如何传递参数?
- 关于ajax弹出对话框的问题
- js刷新框架代码的疑惑(asp.net+c#)
- 一个很cool的菜单效果,谁能把源码提取出来?
- 菜鸟弱问!如何加入相对应的链接!主好写注释,Thank you!
- js onfocus函数执行后不执行onblur
- 请问chinaasp.com论坛里左边动态选择列表以及FRAME是怎么做的??
- 在js里,怎样输出数组的所有内容?谢谢
mycode="Loading<!--ok<!object->ay-->";
正则用的好帅!
简单解释一下好吗?
<script>
alert("Loading<!--okay-->--><object>".replace(/(.*<!--)(.*)(-->.*)/g, "$2"));
</script>
显示的是okay-->对吧
表示子條件
$0~$9表示符合第0~9的結果
從$1到$9Characters Meaning
$$ $ (JScript 5.5 or later)
$& Specifies that portion of stringObj that the entire pattern matched. (JScript 5.5 or later)
$` Specifies that portion of stringObj that precedes the match described by $&. (JScript 5.5 or later)
$' Specifies that portion of stringObj that follows the match described by $&. (JScript 5.5 or later)
$n The nth captured submatch, where n is a single decimal digit from 1 through 9. (JScript 5.5 or later)
$nn The nnth captured submatch, where nn is a two-digit decimal number from 01 through 99. (JScript 5.5 or later)
http://expert.csdn.net/Expert/topic/1355/1355443.xml?temp=.9495661