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*

2
  • 1
    Ah, but the whole point of mine was to avoid the need to specify the pattern and instead read it from the first line. Your approach will simply delete any line that starts with ID. You have no guarantee that this won't delete lines that should be kept. Since you brought up elegance, g is pointless if you use ^ and $. In fact, all of your options to m/// are useless here except s; they activate features you're not using. So's the $, s/^ID.*//s would do the same thing. Commented Jan 28, 2016 at 10:37
  • @terdon, fair enough. Yours is much more universal! Commented Jan 28, 2016 at 19:39