... 3. 已命名捕获组(Named Groups) 4. 字词边界(Word Boundaries) 不幸的是,字词边界一般都被忽视掉了,大部分人都没有在意他的现实意义 例如,如果你想要匹配单词“import”: ...
基于149个网页-相关网页
Non-capturing and Named Groups 无捕获组和命名组
If you prefer to use numbered groups instead of named groups, this function will still work for you.
如果您喜欢用编号组而非命名组,则此函数仍然有效。
The above expression will create the same effect as the previous back reference example, but by instead using named groups. It is also significantly easier to read.
上面的表达式将产生和前面的反向引用同样的效果,但通过使用命名组,这将明显地更便于阅读。
You can even place related Settings into named groups for easier use and readability.
您甚至可以将相关设定置于具名群组内,以期更便于使用并增进可读性。
应用推荐