Perl: the Markov chain saw | |
PerlMonks |
Re: Modify C comment removal code to kill newlinesby Velaki (Chaplain) |
on Aug 21, 2006 at 13:48 UTC ( [id://568543]=note: print w/replies, xml ) | Need Help?? |
Here's a little snippet that produces the output you desire. However, it doesn't really take into account nested comments or multiline comments, but you can extend that on your own. By the way, your last line of sample code /*The end!/*} is not a valid comment terminator. I think you meant /*The end!*/}.
Hope this helped,
"Perl. There is no substitute."
Update: Changed the regexes to reflect anjiro's comments.
In Section
Seekers of Perl Wisdom
|
|