LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] strip comments utility

[ILUG] strip comments utility

JustinMacCarthy macarthy at iol.ie
Fri Dec 8 13:12:02 GMT 2000


The regex is pretty difficult for these, but so useful that it is inclued in
the perl FAQ!

Here it for you pleaseure . Perl style

$/ = undef;
    $_ = <>;

s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#
$2#gs
    print;

There is a commented (legible) version in the faq  (part 6?) for those with
interest,
+ modification for c++ sytle comments

Justin MacCarthy


>-----Original Message-----
>From: ilug-admin at linux.ie [mailto:ilug-admin at linux.ie]On Behalf Of
>Michael Turley
>Sent: Thursday, December 07, 2000 8:08 PM
>To: ilug at linux.ie
>Subject: [ILUG] strip comments utility
>
>
>Does anyone know of a utility to strip C style (/* */)
>comments from code. I have a rake of stuff with alot
>of CVSg material which I would like to remove. Does
>CVS have this type of functionality?
>
>=====
>Mr. Michael Turley
>Gracious winner, Generous lover, All round great guy.
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Shopping - Thousands of Stores. Millions of Products.
>http://shopping.yahoo.com/
>
>--
>Irish Linux Users' Group: ilug at linux.ie
>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
>List maintainer: listmaster at linux.ie
>
>





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell