parsing nested parentheses in python, grab content by level
问题 Apparently this problem comes up fairly often, after reading Regular expression to detect semi-colon terminated C++ for & while loops and thinking about the problem for a while, i wrote a function to return the content contained inside an arbitrary number of nested () The function could easily be extended to any regular expression object, posting here for your thoughts and considerations. any refactoring advice would be appreciated (note, i'm new to python still, and didn't feel like figuring