It would be cleaner and easier to understand if you just pass in `match.result` from the replaceAll case instead of having to deal with both cases here.