2 things you should note:
- Strings in Java are immutable to so you need to store return value of thereplace method call in another String.
- You don't really need a regex here, just a simple call to String#replace(String) will do the job.
So just use this code:
String replaced = string.replace("abcd", "ffffdd");