更新时间:2022-11-14 18:46:14
Just use \1
... \9
(or $1
... $9
在某些正则表达式实现中),就像您通常会做的那样.编号是从左到右,基于开放括号的位置(因此嵌套组的编号大于嵌套组的编号).
Just use \1
... \9
(or $1
... $9
in some regex implementations) like you normally would. The numbering is from left to right, based on the position of the open paren (so a nested group has a higher number than the group(s) it's nested within).