Regex help on non-capturing groups

前端 未结 2 732
清歌不尽
清歌不尽 2021-01-24 10:19

Must be a duplication but I can\'t seem to find it...

I am using a group to match a repeating sub-string. However, I do not want the group to be captured. This seems to

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-24 11:01

    The reason this won't work is that when you write \1 you basically say "the content of the first group", which is of course undefined if the group is non-capturing.

提交回复
热议问题