久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      JS 正則表達(dá)式中小括號(hào)的應(yīng)用

      主要使用的有下面三種:

      1.  (...)

      Grouping. Group items into a single unit that can be used with *, +, ?, |, and so on. Also remember the characters that match this group for use with later references.

      2. (?:...)

      Grouping only. Group items into a single unit, but do not remember the characters that match this group.

      3.

      (?=pA positive lookahead assertion. 或

      (?!p)  A negative lookahead assertion.

       

      用于測(cè)試的字符串:url(skins/default/images/index/default.png)

      紅色字符為匹配上的結(jié)果

      第一種,用于普通分組,能記住匹配該分組的字符串,并且可以在以后通過(guò)1的方式來(lái)引用所匹配到的分組

             eg: (/)匹配url(skins/default/images/index/default.png)

                 (/)default1匹配url(skins/default/images/index/default.png)

       

      第二種,用于分組,不記錄匹配該分組的字符串

             eg: (?:/)default匹配url(skins/default/images/index/default.png)

       

      第一、二兩種方式匹配的結(jié)果里都包含有該分組匹配到的結(jié)果,在例子中是”/default“中的”/

       

      第三種,只用于確定位置,最終結(jié)果里并不包含該括號(hào)匹配到的結(jié)果

             eg:  (?!/)default匹配url(skins/default/images/index/default.png)

             eg:  default(?=/)匹配url(skins/default/images/index/default.png)

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)