in reply to Re: Re: removing C style comments from text files
in thread removing C style comments from text files
You have to do it all in one pass. Something like:/* One " two */ a = b + 4; /* three " four */
But that isn't fool proof either (consider # define).s { ( [^"'/]* # Not a string, character o +r comment. | "[^\\"]*(?:\\.[^\\"]*)*" # String. | '[^\\']*(?:\\.[^\\']*)*' # Char. | / (?![*]) # Slash, not a comment. ) | ( /[*] [^*]* (?: [*] [^*/]* )* [*]/ ) # Comment. } { $2 ? "" : $1 }gsex;
Abigail
|
|---|