Support for methods replaceFirst and replaceAll. Only works in Java 7.