I need to split a string in java with a regex, but i'm not quite sure how to. I have to split
[Caps][RCaps]C[Caps][RCaps]atalog[Caps][RCaps]
By the words inside the square brackets. I somehow need to get all the parts of the string.
Expected output:
[Caps]
[RCaps]
C
[Caps]
[RCaps]
atalog
[Caps]
[RCaps]
And the text inside the square brackets could be whatever. In this case, it is "Caps" and "RCaps" but it could also be "Potato" for example
after ]orbefore [? So what is the problem with your code?