<!-- date: 2010-05-03 -->
<!-- title: Zero Length Regular Expression -->
<!-- tag: Perl, Python, Java, Lisp, Programming, Technology -->
<!-- key: ywxjf -->
<p>
  This post presents a list of how zero length regular expression is
  handled in various tools and programming languages.  All of them
  compile the zero length regular expression pattern and the regular
  expression matches all strings.
</p>
<h2 id="gnu-grep">GNU grep</h2>
<pre>
<samp>$ <kbd>printf "foo\nbar\n" | grep ""</kbd>
foo
bar</samp>
</pre