複数行の文字列のreplaceAllに問題があります。
String regex = "\\s*/\\*.*\\*/";
String testWorks = " /** this should be replaced **/ just text";
String testIllegal = " /** this should be replaced \n **/ just text";
testWorks.replaceAll(regex, "x");
testIllegal.replaceAll(regex, "x");
上記はtestWorksでは機能しますが、testIllegalでは機能しません!?それはなぜですか、どうすればこれを克服できますか?複数行にまたがるコメント/*...*/のようなものを置き換える必要があります。