python regex to replace body of functions in C -
lets have functions in c this:
int main(){ if(1){ printf("1"); } }
what need find function body in { }
, replace empty string. bothers me because of { }
, can nested infinitely. there way find bodies or have use stack, or variables store nesting.
unless regex learning project undertaken solely interest should consider taking more professional approach. appear have decided regex appropriate approach without considering alternatives.
i'd suggest looking @ using pycparser, heavy lifting , present program in form makes easy want.
Comments
Post a Comment