A token can be like this {num}
or {num:2}
(2 being an arg)
I would like to achieve matching like this:
// no args
[0] = num
// args (anything after the colon and before the closing brace as one match is fine)
[0] = num
[1] = 2
I managed to match anything in the braces that was easy but my regex is too noob to get anything more complex than that! Thanks.
FYI I am using javascript and \{(.*?)\}
matches all the contents within.