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) :
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"?
正则表达式: (?!\/)default(?=\/)
其中(?!\/)表示以"/"开头,(?=\/)表示以"/"结尾
正则表达式,位置匹配
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 永恒英文金曲精选4《TheBestOfEverlastingFavouritesVol.4》[WAV+CUE]
- 群星《国风超有戏 第9期》[320K/MP3][13.63MB]
- 群星《国风超有戏 第9期》[FLAC/分轨][72.56MB]
- P1X3L《P1X3L》[320K/MP3][143MB]
- 群星.2022-良辰好景知几何电视剧原声带【SONY】【FLAC分轨】
- 庾澄庆.1991-管不住自己【福茂】【WAV+CUE】
- 欧倩怡.2001-Cindy(EP)【华星】【WAV+CUE】
- P1X3L《P1X3L》[FLAC/分轨][791.28MB]
- 茵达INDAHKUS《茵 the Blue》[320K/MP3][33.49MB]
- 茵达INDAHKUS《茵 the Blue》[FLAC/分轨][147.57MB]
- 老虎鱼AnneClarkwithUllavanDaelenJustinCiuche-Borderland-HiRes-Files24bit88.2kHz
- 江玲2004-百合盛开2CD[歌林][WAV+CUE]
- 孙露《怕什么孤单3CD》深圳音像[WAV分轨]
- s14全球总决赛目前是什么结果 s14全球总决赛赛程结果图一览
- s2TPA夺冠五人名单都有谁 tpa战队s2夺冠队员名单一览