fix(validation): don't translate indices

In addition, simplify implementation by adapting approach from String#replaceAll(regex, replacement).