I need a help in regular expression, I am trying to replace "Inc" with "LLC" for many string.
I used this code in java :
String newValue = newValue.replaceAll("(?i)Inc[^\\w]","LLC");
But the result is incorrect, one char is removed after replacing :
Exp: CONSULTANTS, INC. ("ABC") ==> CONSULTANTS, LLC ("ABC") // the "." was removed.
Please note that i have used [^\w] to prevent replacing "inc" in sentences like "include".