Obtain string inside curl bracket in python
Question: Suppose I have a string like

    
    
    {"", "b", "c"}, // we are here 
    

I would like to extract the `{"", "b", "c"}` and/or `"", "b", "c"` part of it.
Is there any simple prescription for it?


Answer: You can use regex - `re.search`:

    
    
    import re
    
    s = '{"", "b", "c"}, // we are here'
    m = re.search(r'{.*}', s)
    print(m.group(0))
    #'{"", "b", "c"}'
    

`{.*}` matches every thing within the curly braces and the braces.

