title: How to use sed to return something from first line which matches and quit early?
body: <p>I saw from</p>
  
  <p><a href="https://stackoverflow.com/questions/148451/how-to-use-sed-to-replace-only-the-first-occurrence-in-a-file">How to use sed to replace only the first occurrence in a file?</a></p>
  
  <p>How to do most of what I want:</p>
  
  <pre><code>sed -n '0,/.*\(something\).*/s//\1/p'
  </code></pre>
  
  <p>This finds the first match of something and extracts it (of course my real example is more complicated).  I know sed has a 'quit' command which will make it stop early, but I don't know how to combine the 'q' with the above line to get my desired behavior.</p>
  
  <p>I've tried replacing the 'p' with {p;q;} as I've seen in some examples, but that is clearly not working.</p>