i trying delete macros c headers have problem deleting multiple line macros. example
#define macro(char) \ //macro still continues \ //macro still continues \
this regexp deleting one-line macros not quite sure how include \n in regular expression.
text=re.sub('#([\w\w\s\d])*?\n', '', text, re.s)
text=re.sub('#([\w\w\s\d])*?(\n.*?\\\\)*\n', '', text, re.s | re.m)
should trick
edit: fix @blackie123
Comments
Post a Comment