I never was a regex expert, so I need some help with the following.
I have the following string: '<param1>(/<param2>(/<param3>(/<param4>)))'.
This is a kind of url structure.
I want to extract: 'param1', 'param2', 'param3', 'param4' and to check if they are optional.
A param is optional if it is in parenthesis (param2, param3 and param4 in this case).
Thanks in advance.
(and popping if you hit a). You have an optional parameter if the stack is not empty.