title: How can I convert ereg expressions to preg in PHP?
body: <p>Since <a href="http://php.net/regex" rel="noreferrer">POSIX regular expressions (ereg)</a> are deprecated since PHP 5.3.0, I'd like to know an easy way to convert the old expressions to <a href="http://php.net/pcre" rel="noreferrer">PCRE (Perl Compatible Regular Expressions) (preg)</a>.</p>
  <p>Per example, I have this regular expression:</p>
  <pre><code>eregi('^hello world');
  </code></pre>
  <p>How can I translate expressions into <code>preg_match</code> compatible expressions?</p>
  <blockquote>
  <p><strong><em>Note:</em> This post serves as a placeholder for all posts related to conversion from ereg to preg, and as a duplicate options for related questions.</strong> Please do not close this question.</p>
  <p><strong>Related:</strong></p>
  <ul>
  <li><a href="https://stackoverflow.com/q/1374881/367456">How to change PHP's eregi to preg_match</a></li>
  <li><a href="https://stackoverflow.com/questions/6269693/changing-ereg-replace-to-equivalent-preg-replace">Changing ereg_replace to equivalent preg_replace</a></li>
  </ul>
  </blockquote>