From: "ara.t.howard" Date: 2007-09-19T23:30:33+09:00 Subject: Re: how can I remove all the comments in my c program. On Sep 19, 2007, at 4:20 AM, Vellingiri Arul wrote: > Dear Friends, > using The Ruby how can I remove all the comments in my c program. > For example I have mentioned c program ,that may be ruby program > for your purpose you assume. > I have tried to do using the regular expression. > But I was unable to find the anser for this. > > > Please any one tell me. > i'd start with c's own preprocessor and go from there: cfp:~ > cat a.c /* comment be gone */ main(){ printf("%i\n", (int)(0.55 * 100)); } cfp:~ > cpp a.c # 1 "a.c" # 1 "" # 1 "" # 1 "a.c" main(){ printf("%i\n", (int)(0.55 * 100)); } cfp:~ > cpp -P a.c main(){ printf("%i\n", (int)(0.55 * 100)); } it already knows how to strip comments. a @ http://drawohara.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama