In Java, when doing a replaceAll to look for a regex pattern like:
replaceAll(\"\\\\?i\\\\b(\\\\w+)\\\\b(\\\\s+\\\\1)+\\\\b\", \"$1\");
(t
You can also match case insensitive regexs and make it more readable by using the Pattern.CASE_INSENSITIVE constant like:
Pattern mypattern = Pattern.compile(MYREGEX, Pattern.CASE_INSENSITIVE); Matcher mymatcher= mypattern.matcher(mystring);