Regex in replace methods converted in Java.