Is it possible with regex to repeat a captured group an amount of times with the added restriction that the amount to repeat is also found in a capture group?
Example:
Regex: /(a)([0-9])/g
String: ba1na3na2
Expected result: banaaanaa
I have never seen anything that does this, but maybe I have been looking in the wrong places. Note: I am using Perl - but I am interested to see answers for other flavours as well.