I've tried this in powershell with -replace and with [RegEx]::replace. same issue. I want to use the value in a capture group to retrieve its value from a lookup duing the replace on a string.
assuming t is a a valid hash table of key/value where one key is 'gif'.
[RegEx]::Replace($_, "((/aaa)?/bbb[^']+).(jpg|png|bmp|gif)", "--`$1--`$2--`$3--$($t.Item('`$3'))++++`$1-UUUUU.`$3")
Needless to say, i've been unsuccessful with getting the hash lookup to work in this substitution.