Reputation: 23
I'm a regex novice and I cannot figure out how to match the following:
String example:
"This is my string [something: something] and the string is very pretty [something: something][a][b][c]."
At the moment I got a regex that matches all start and end square brackets. \[([^]]*)\]
.
This yields the following
I want to group standalone brackets and brackets which has brackets next to it.
The regex should group it like;
Anyone able to help?
Upvotes: 0
Views: 92