String.replaceAll variant that handles each match using closure

I would like to replace regexp using this function instead of loops every time. The original function replaceAll is not always enough powerful so it's nice to do something like:

```kotlin
mystring.replaceAll("test-([a-z]+)") { (mr) -> mr.group(1).toUpperCase() }
```