I need to find a pattern in a Java String and replace for another string.
I have two kinds of Strings
1- Lorem ipsum dolor sit amet, it. Integer pos laciniA. 2. Lorem ipsum dolorelit. Curabitur pretium maL.
What I need to do is to find a "." that don't have a number before it and replace by ";"
I've found the regex to do this like str.replaceAll('\.', '\\;');
The problem with this patter is that when it find the String "2." it changes by "2;"
Another solution is str.replaceAll('[a-zAz]\.', '\\;'); but it replace the last letter before ".".
Someone can help-me with this?
str.replaceAll("(?<!\\d)\\.", ";")?