How can you match the last occurrence of a regex pattern?
For example, how can I match [XXX] to:
data[X][XX][XXX]
Where X, XX, XXX can be assigned randomly.
I already tried to use negative view
\[.*?\](?!.*?\[.*?\])
But the first [with the last] will correspond to that which does not give the correct result.
source
share