perl -pe 's/\d+/$&+1/ge' <<<"$str"
g flag to the substitution would make Perl apply the expression for each non-overlapping match on the input line.
Nitpick: There are actually no capture groups involved here (the original question mentioned capture groups). The Perl variable
$& is the "string matched by the last successful pattern match". This is different from e.g.
$2 etc. that refer to the string matched by the corresponding capture group (parenthesised expression). There are no capture groups in
\d+, but you could have used
s/(\d+)/$1+1/ge instead, which does use a single capture group.
There is no difference between
s/\d+/$&+1/ge in terms of outcome. In this short in-line Perl script, it makes no difference whether you choose to use one or the other, but generally you'd like to avoid using
$& in longer Perl programs that do many regular expression operations, at least if using an older Perl release.
perldoc perlvar (my emphasis):
Traditionally in Perl, any use of any of the three variables
use English equivalents) anywhere in the code, caused all
subsequent successful pattern matches to make a copy of the matched
string, in case the code might subsequently access one of those variables.
This imposed a considerable performance penalty across the whole program,
so generally the use of these variables has been discouraged.
In Perl 5.20.0 a new copy-on-write system was enabled by default, which
finally fixes all performance issues with these three variables, and makes
them safe to use anywhere.