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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -