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.
For example
/a/foo.js
The expression above/a/(**.js)
$0
:/a/foo.js
$1
:foo.js
update:
Can refer tohttps://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp
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 [1], ..., [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.
In brief:
$0
Is all the matching content,$1
Is the first parenthetical match, …$9
Is the ninth bracket match