![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scripting comments | gliesian | Shell Programming and Scripting | 4 | 03-28-2008 06:32 AM |
| OMG BPMN 2: comments for CEP | iBot | Complex Event Processing RSS News | 0 | 03-11-2008 10:20 AM |
| lint comments | axes | High Level Programming | 5 | 01-05-2008 08:14 AM |
| Print comments in FTP | lweegp | UNIX for Dummies Questions & Answers | 7 | 10-12-2005 05:55 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Remove comments...
It may be a no-brainer, but the answer is escaping me right now:
I'm trying to write a little script to remove all comments from .c source... I was thinking sed, but I'm not a very strong regexp user (e.g. I suck with sed). I tried dumping the file into: sed -e 's/\/\* * \*\///g' and several variants of it, but I can't seem to get all of the comments out. The main issue is to remove multiline comments from programmers that think they should document ALL technical details in the beginning of the source, as opposed to putting it in a seperate file. The sources that I'm trying to make smaller (they're just slightly too big for a floppy) contain dozens of pages of comments for a relatively small .c file... |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
if you happen to be able to view the book "Mastering Regualr Expresstions" by Oreilly page 171-174 are pretty much dedicated to writeing a regx for this very purpose.
taken from the book: Code:
/\*[^*]*\*+([^/*][^*]*\*+)*/ |
|||
| Google The UNIX and Linux Forums |