I am reading in Strings from a file like...an example would be:
I JUMP UP HIGH IN THE AIR WITH SOUP TO GET TO YOU.
How would I do a conditional replaceAll, e.g. replace all P at end of word unless the word ends with UP.
This what I tried based on the example for U at the end of the word:
s = s.replaceAll("(!UP\\b)P\\b", "PS")
The above I would expect to change the string s to:
I JUMPS UP HIGH IN THE AIR WITH SOUP TO GET TO YOU.