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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -