Fixed replacement regexes because tests were in Java