Here is the scenario.
String strText = \"ABC abc Abc aBC abC aBc ABc AbC\"; // Adding a HTML content to this String searchText = \"abc\"; String strFormatted = s
You can use a backreference. Something like:
String strFormatted = strText.replaceAll( "(?i)(" + searchText + ")", "$1");