麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 編程 > Regex > 正文

JS 正則表達式的位置匹配

2020-03-16 21:14:28
字體:
來源:轉載
供稿:網友
JS中正則表達式的位置匹配代碼,國外翻譯的文章。
 
 

http://regexpal.com/

上面這個網站可以用于在線檢測JS的正則表達式語法

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

^ : 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.

 

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

 

(?=p) :

p

 

(?!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"?

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

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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 91成人免费版 | 亚洲国产成人一区 | 国产成人av免费看 | 久久久久久久久成人 | 精品国产91久久久久久久妲己 | 午夜视频在线观看免费视频 | 91 在线视频观看 | 久久6国产 | 在线中文字幕观看 | 午夜亚洲视频 | 91午夜在线观看 | 男女无套免费视频 | 欧美电影在线观看 | 午夜视频久久 | 日韩理论电影网 | av中文在线观看 | 中文区永久区 | 欧美性受xxxx人人本视频 | www视频免费在线观看 | 欧美色视频免费 | 久草最新在线 | 国产精品视频一区二区三区四区国 | 亚洲成人激情av | 国产毛片网 | 曰批全过程120分钟免费69 | 97zyz成人免费视频 | 亚洲午夜精选 | 精品国产91久久久久久浪潮蜜月 | 日本中文字幕网址 | 99爱国产精品 | 一区二区三区四区视频在线观看 | 免费h片| 久产久精品 | 久久久久久久一区二区三区 | 久久久久久久久日本理论电影 | 欧美黄色免费视频 | 一级在线 | 黄色一级片毛片 | 午夜精品福利视频 | 国产精品久久国产精麻豆96堂 | 久国产 |