I have a ListView and a search_term. I want to highlight (by coloring red) all instances of the search_term in the ListView. This works and is easy.
text = text.replaceAll(search_term, "<font color='red'>$1</font>");
I am now trying to make it work in a case in-sensitive manor. I thought the following was correct but it is not working.
text = text.replaceAll("(?i)" + search_term, "<font color='red'>$1</font>");
SO basically I want to color all instances of the search_term in red, I want to ignore case when matching but not when coloring.
Here are 3 examples. The search_term is "apple" and bold represents the color red.
"The apple is red" -> "The apple is red"
"The Apple is red" -> "The Apple is red"
"The APPLE is red" -> "The APPLE is red"
Kind Regards, Cathal