I have a string which has multiple brackets. Let says
s="(a(vdwvndw){}]"
I want to extract all the brackets as a separate string.
I tried this:
>>> brackets=re.search(r"[(){}[]]+",s)
>>> brackets.group()
But it is only giving me last two brackets.
'}]'
Why is that? Shouldn't it fetch one or more of any of the brackets in the character set?