JetBrains/kotlin — pull request #309 by cy6erGn0m (2013-10-03 05:52:47+00:00)
Title: 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() }
```