in reply to removing C style comments from text files
The other issue is keeping what is supposed to match the inside of the comment from matching the end, some more code, and the beginning and inside of another comment. The simple m/\/\*.*\*\//s regex will match all of "/* comment 1 */ some = code; /* comment 2 */". You tell * to match as little as possible instead of as much as possible by adding a ?, so it becomes m/\/\*.*?\*\//s.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: removing C style comments from text files
by dominix (Deacon) on Jan 06, 2004 at 09:12 UTC | |
by ctp (Beadle) on Jan 07, 2004 at 04:05 UTC | |
by dominix (Deacon) on Jan 07, 2004 at 08:30 UTC | |
Re: Re: removing C style comments from text files
by ctp (Beadle) on Jan 06, 2004 at 18:06 UTC |