|
Oct
01
|
By default regexp matching is case sensitive. To make it case insensitive use the CASE_INSENSITIVE flag in your regex. It can be embedded in the regex string using (?i).
String s = "aBcXYZABCdefAbc";
String replaced = s.replaceAll("(?i)abc", "123");



December 10th, 2011 at 6:14 pm
Brilliant code! Helped a lot! Thank you!