Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: removing C style comments from text files

by dominix (Deacon)
on Jan 06, 2004 at 09:12 UTC ( [id://319055]=note: print w/replies, xml ) Need Help??


in reply to Re: removing C style comments from text files
in thread removing C style comments from text files

so within ysth restrictions, if one wants a one-liner perl -0777 -pe 's{/\*.*?\*/}{}gs' source.c my .02
--
dominix

Replies are listed 'Best First'.
Re: Re: Re: removing C style comments from text files
by ctp (Beadle) on Jan 07, 2004 at 04:05 UTC
    I just tried it and it worked! I've never seen a regex contained in braces before...and what's the deal with the empty braces at the end?

    thanks!
      you can use brace in place of traditional // in match
      m{ } <=> m/ / and in searchreplace s{what}{replace}imsogxe <=> s/what/replace/imsogxe
      in perlretut you have these examples. "/World/", "m!World!", and "m{World}" all represent the same thing. so the empty Brace means "replace with nothing"
      --
      dominix

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://319055]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-16 13:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found