什么是“?:^”正则表达意味着什 [英] What does the "?:^" regular expression mean?
本文介绍了什么是“?:^”正则表达意味着什的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在查看这个子表达式(这是在JavaScript中):
I am looking at this sub-expression (this is in JavaScript):
(?:^|.....)
我知道?表示零次或一次当它跟随一个角色,但不确定它在这个背景下意味着什么。
I know that ? means "zero or one times" when it follows a character, but not sure what it means in this context.
推荐答案
你可能在这个背景下看到它
You're probably seeing it in this context
(?:...)
这意味着该组不会被捕获或用于反向引用。
It means that the group won't be captured or used for back-references.
编辑:反映您修改过的问题:
To reflect your modified question:
(?:^|....)
表示匹配开头的行或匹配......但不要捕获该组或将其用于反向引用。
means "match the beginning of the line or match ..." but don't capture the group or use it for back-references.
这篇关于什么是“?:^”正则表达意味着什的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文