What does the “?:^” regular expression mean?

后端 未结 6 1095
悲&欢浪女
悲&欢浪女 2021-02-01 08:39

I am looking at this sub-expression (this is in JavaScript):

(?:^|.....)

I know that ? means \"zero or one times\" when it fol

6条回答
  •  Happy的楠姐
    2021-02-01 09:15

    ?: Generally indicates making the group a non capture. You can do some research here.

    I'm almost positive any regex engine should but when I switch between engines I run into some quirks.

    Edit: This should be the case, non captures seems to work fine.

提交回复
热议问题