久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      JS 正則表達(dá)式的位置匹配


      http://regexpal.com/

      上面這個網(wǎng)站可以用于在線檢測JS的正則表達(dá)式語法

      除了熟知的幾個固定字符表示位置:

      ^ : Match the beginning of the string and, in multiline searches, the beginning of a line.

      $ : Match the end of the string and, in multiline searches, the end of a line.

      b: 

      Match a word boundary. That is, match the position between a w character and a W character or between a w character and the beginning or end of a string. (Note, however, that [b] matches backspace.)

      B: Match a position that is not a word boundary.

      還有的就是使用正則表達(dá)式來確定要匹配的位置,也叫做Zero-Width Test(零寬斷言)

      (?=p) :

      A positive lookahead assertion. Require that the following characters match the pattern p, but do not include those characters in the match.

      (?!p) :

      A negative lookahead assertion. Require that the following characters do not match the pattern p.

      對于(?=p)和(?!p)的使用舉一個例子:

      要在url(skins/default/images/index/default.png)中匹配"/default/"中的"default",而不匹配"/default.png"中的"default"?

      正則表達(dá)式: (?!/)default(?=/)

      其中(?!/)表示以"/"開頭,(?=/)表示以"/"結(jié)尾

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