>_ IzzyLab

Topic breakdown

The address before a sed command is not only a regular expression but also a line number, and a comma defines a range N,M (from line N to line M inclusive). By combining a range address with an ordinary substitution s/.../.../, you apply the replacement only to lines inside the range, while everything outside it stays untouched. The ^ anchor in the pattern ties the match to the start of the line.

What's checked

  1. substitution only in lines 2-4

What it looks like