in reply to Regular expression..

In general, to be able to correctly delete comments from a language, you need to be able to fully or partially parse it. I seriously doubt you'll be able to remove comments from Ruby with a handful of simple regexes. You certainly will not be able to do this correctly by looking it line by line.

Replies are listed 'Best First'.
Re^2: Regular expression..
by Anonymous Monk on Oct 29, 2010 at 09:23 UTC
    Yes, I parse the file line by line only but I unable to write the regular expression correctly. Can you give me the regular expression to solve my requirement. You consider that I pares the file line by line and want to remove the comments from the file.
      Yes, I parse the file line by line only but I unable to write the regular expression correctly.
      Which part of You certainly will not be able to do this correctly by looking it line by line do you fail to understand?
      Can you give me the regular expression to solve my requirement.
      Which part of I seriously doubt you'll be able to remove comments from Ruby with a handful of simple regexes do you fail to understand?
        Instead of line by line how can I parse the file. Can you give me any suggestion or way to do that one.