title: sed print line with nth occurrence of regex
body: <p>lets say we have the following data</p>
  
  <pre><code> B346879 length: 12 B34 L677
   B111879 length: 32 B33 L677
   B545879 length: 34 B34 L677
   B344879 length: 98 B33 L677
   B090879 length: 45 B33 L677
  </code></pre>
  
  <p>i'm looking for 'B34' so from this series I would want to print the 1st and 3rd line.
  But if I would use:</p>
  
  <pre><code>cat t.txt | sed -n '/B34/p' | awk '{print $1", "$4" "$5}' | sed 's/B//g'
  </code></pre>
  
  <p>The 4th line would also be printed because 'B34' matches the first 3 chars of 'B344879. I know that with something like <code>sed 's/pattern/replacement/n'</code> you can replace only the nth occurance of a regex. But how does it works with printing. I tried stuff like <code>sed -n '/B34/2p'</code> but that's invalid.</p>