<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                | JScript? | [語言參考](#) | |-----|-----| # lastIndex 屬性 返回字符位置,它是被查找字符串中下一次成功匹配的開始位置。 **`RegExp.lastIndex`** 與該屬性有關的對象總是全局 **RegExp **對象。 #### 說明 **lastIndex** 屬性是基于零的,也就是說,第一個字符的索引是零。其初始值為 -1,不論何時產生一個成功匹配,它的值都被修改。 lastIndex 屬性被 RegExp 對象的 exec 和 test 方法,以及 String 對象的 match、replace、和 split 方法修改。 下面的規則應用于 **lastIndex** 的值: - 如果還沒有匹配,則 lastIndex 被設置為 -1. - 如果 **lastIndex** 比字符串的長度大,則 **test** 和 **exec** 失敗,并且 **lastIndex** 被設置為 -1。 - 如果 **lastIndex** 等于字符串的長度,且模式與空字符串匹配,則正則表達式匹配。否則,匹配失敗并且 **lastIndex** 被重置為 -1。 - 否則,**lastIndex** 被設置為緊接最近的匹配的下一個位置。 #### 示例 下例闡明了 **lastIndex** 屬性的用法。該函數重復了查找字符串,并打印出字符串中每一個字的 **index** 和 **lastIndex** 值。 ~~~ function RegExpTest(){ var ver = Number(ScriptEngineMajorVersion() + "." + ScriptEngineMinorVersion()) if (ver >= 5.5){ var src = "The rain in Spain falls mainly in the plain."; var re = /\w+/g; var arr; while ((arr = re.exec(src)) != null) print(arr.index + "-" + arr.lastIndex + "\t" + arr); } else{ alert("You need a newer version of JScript for this to work"); } } ~~~ #### 要求 [版本3](#) #### 請參閱 [RegExp 對象的屬性](#) | [正則表達式語法](#) 應用于: [RegExp 對象](#) [? 2000 Microsoft Corporation 版權所有。保留所有權利。使用規定。](#)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看