pos1=mycode.indexOf("<")
pos2=mycode.indexOf(">")
mycode=mycode.substr(pos1,pos2)

解决方案 »

  1.   

    mycode=mycode.substr(pos1+3,pos2-3)
      

  2.   

    我真正的字符是不固定的,有可能是:
    mycode="Loading<!--ok<!object->ay-->";
      

  3.   

    alert("Loading<!--okay--><object>".replace(/(.*<!--)(.*)(-->.*)/g, "$2"));
      

  4.   

    to:wsj(骆驼) 
    正则用的好帅!
    简单解释一下好吗?
      

  5.   

    好像是从两头向中间找
    <script>
    alert("Loading<!--okay-->--><object>".replace(/(.*<!--)(.*)(-->.*)/g, "$2"));
    </script>
    显示的是okay-->对吧
      

  6.   

    (para)
    表示子條件
    $0~$9表示符合第0~9的結果
      

  7.   

    對不起
    從$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) 
      

  8.   

    请再帮我一下!
    http://expert.csdn.net/Expert/topic/1355/1355443.xml?temp=.9495661