Using a regex counter as output

173 Views Asked by At

Is there a counter that regex 'uses' that can be out put?

For instance, if I have this text:

(),
(),
(),
()

I want to use a regex pattern to add the count to the output for each match. so in this case the desired result would be:

(1),
(2),
(3),
(4)

Surely there is an internal counter, but can it be used as output?

0

There are 0 best solutions below