Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • well, I agree with terdon: Lets see the expected output. Commented Jul 21, 2016 at 12:20
  • BTW: What should happen to a single line containing: "/*foo*/run;/*bar*/" ? Should that just be "run;" ? Commented Jul 21, 2016 at 12:29
  • Great! Then my solution works. Note I use non-greedy: ".+?" Commented Jul 21, 2016 at 12:32
  • 2
    See -0777 as a shorter way to do BEGIN{$/=undef} Commented Jul 21, 2016 at 13:30
  • 1
    Perhaps .*? instead of .+? if /**/ is a valid comment too. Commented Jul 21, 2016 at 20:57