I'm looking for a solution to find if a :-char is enclosed by [ and ] or not.
I have a sort of syntax which enables to define keys with corresponding values in a template. The syntax is exploded by :-char to identify the keys, but a :-char should also be valid if it's within the brackets. Basically my sample/case is like:
:key1[value]:key2[this:value should work too]
.
I'm looking for a way to find if :-char is within the brackets. I've started writing out a procedure to figure this out, but somewhere during the writing an electronic pulse in my mind said 'regex.. regex'. But I'm quite unfamiliar with them. Could someone help me out?
P.s. if you're downvoting the question, at least tell me why you think its a bad question. In my opinion its a correct question I'm asking assistance for.