regex [ ]
Documentation for regex
[ ] assembled from the following types:
The parentheses in regexes perform a double role: they group the regex elements inside and they capture what is matched by the sub-regex inside.
To get only the grouping behavior, you can use square brackets
[ ... ] which, by default, don't capture.
if 'abc' ~~ / [a||b] (c) /
If you do not need the captures, using non-capturing
[ ... ] groups provides the following benefits:
they more cleanly communicate the regex intent;
they make it easier to count the capturing groups that do mean;
they make matching a bit faster.