I want to match regex pattern in java for particular text. In that while matching I need to find matches in reverse order.
Example:
Regex Pattern -- [([^]]*])
Input String -- [blue][red][green]
Output -- 1st match --->[blue]
2nd match --->[red]
3rd match --->[green]
But I'm expecting match to be in reverse order.
Expected output -- 1st match --->[green]
2nd match --->[red]
3rd match --->[blue]
Please help how to form the regex to achieve the expected output.