title: Is there a grep equivalent for find's -print0 and xargs's -0 switches?
body: <p>I often want to write commands like this (in <code>zsh</code>, if it's relevant):</p>
  
  <pre><code>find &lt;somebasedirectory&gt; | \
      grep stringinfilenamesIwant | \
      grep -v stringinfilesnamesIdont | \
      xargs dosomecommand
  </code></pre>
  
  <p>(or more complex combinations of greps)</p>
  
  <p>In recent years <code>find</code> has added the <code>-print0</code> switch, and xargs has added <code>-0</code>, which allow handling of files with spaces in the name in an elegant way by null-terminating filenames instead, allowing for this:</p>
  
  <pre><code>find &lt;somebasedirectory&gt; -print0 | xargs -0 dosomecommand
  </code></pre>
  
  <p>However, <code>grep</code> (at least the version I have, GNU grep 2.10 on Ubuntu), doesn't seem to have an equivalent to consume <strong>and</strong> generate null-terminated lines; it has <code>--null</code>, but that only seems related to using <code>-l</code> to output names when searching in files directly with grep.</p>
  
  <p>Is there an equivalent option or combination of options I can use with grep? Alternatively, is there an easy and elegant way to express my pipe of commands simply using find's <code>-regex</code>, or perhaps Perl?</p>