Java regex replace last occurrence. It is used to find the text or to edit the text.