After reading the official documents, I still don’t quite understand what it means and forget the advice of the great god.
After looking at the following documents, this grouping is basically the same as the regular grouping.
/a/foo.jsThe expression above
Explanation of Regular Grouping
(x) Match x and capture matches. This is called capturing parentheses. For example, /(foo)/ matches and captures "foo" in "foo bar." The matched substring can be found in the elements , ..., [n] of the result array, or in the attributes $1, ..., $9 of the defined RegExp object.
Here, $1, …, $9 is the matching content in the first, …, ninth brackets.
$0Is all the matching content,
$1Is the first parenthetical match, …
$9Is the ninth bracket match