<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? | [語言參考](#) | |-----|-----| # global 屬性 返回 Boolean 值,指出正則表達式使用的global 標志 (g) 的狀態。默認值為 **false**。只讀。 `*rgExp*.**global**` 必選項 *rgExp* 參數是**正則表達式**對象。 #### 說明 如果正則表達式設置了global 標志,那么**global** 屬性返回 **true**,否則返回 **false**。 使用 global 標志表明在被查找的字符串中搜索操作將查找所有符合的項,而不僅僅是第一個。這也被稱為全局匹配。 #### 示例 以下示例演示了 **global** 屬性的用法。如果傳遞 "g" 到下面所示的函數中,那么所有的單詞 "the" 將被 "a" 代替。請注意,字符串首的 "The" 不會被替換。這是因為第一個字母是大寫的,因此,不能與 "the" 中小寫的 "t" 匹配。 本函數返回一個字符串以及一個表,表中顯示了與允許使用的正則表達式標志(**g**、**i** 和 **m**)相關的屬性值。它還返回經過所有替換操作后的字符串。 ~~~ function RegExpPropDemo(flag){ if (flag.match(/[^gim]/)) // ~~~ 檢查標志的有效性。 ~~~ return("Flag specified is not valid"); ~~~ ~~~ var r, re, s // ~~~ 聲明變量。 ~~~ var ss = "The man hit the ball with the bat.\n"; ~~~ ~~~ ss += "while the fielder caught the ball with the glove."; ~~~ ~~~ re = new RegExp("the",flag); // ~~~ 指定要查找的樣式。 ~~~ r = ss.replace(re, "a"); // ~~~ 用 ~~~ "a" ~~~ 替換 ~~~ "the" ~~~ 。 ~~~ s = "Regular Expression property values:\n\n" ~~~ ~~~ s += "global ignoreCase multiline\n" ~~~ ~~~ if (re.global) // ~~~ 測試 ~~~ global ~~~ 標志。 ~~~ s += " True "; ~~~ ~~~ else ~~~ ~~~ s += "False "; ~~~ ~~~ if (re.ignoreCase) // ~~~ 測試 ~~~ ignoreCase ~~~ 標志。 ~~~ s += " True "; ~~~ ~~~ else ~~~ ~~~ s += "False "; ~~~ ~~~ if (re.multiline) // ~~~ 測試 ~~~ multiline ~~~ 標志。 ~~~ s += " True "; ~~~ ~~~ else ~~~ ~~~ s += " False "; ~~~ ~~~ s += "\n\nThe resulting string is:\n\n" + r; ~~~ ~~~ return(s); // ~~~ 返回替換字符串。 } #### 要求 [版本 5.5](#) #### 請參閱 [ignoreCase 屬性](#) | [multiline 屬性](#) | [正則表達式語法](#) 應用于:[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>

                              哎呀哎呀视频在线观看