I have a problem with the replaceAll for a multiline string:
String regex = \"\\\\s*/\\\\*.*\\\\*/\"; String testWorks = \" /** this should be replaced **/ j
The meta character . matches any character other than newline. That is why your regex does not work for multi line case.
.
To fix this replace . with [\d\D] that matches any character including newline.
[\d\D]
Code In Action