title: Syntax help - Convert Eregi_replace to preg_replace in PHP
body: <p>We just upgrade to PHP7 and the eregi function is now not working and I need to convert it to preg_replace. I've looked over a couple other topics which are requesting the same thing. I am having an issue with the syntax.</p>
  
  <p>Current code</p>
  
  <pre><code>$body = eregi_replace("[\]", '', $body);
  </code></pre>
  
  <p>I've tried the following but it looks like it's not fully working as $body looks to be empty.</p>
  
  <pre><code>$body = preg_replace('[\]', '', $body);
  </code></pre>
  
  <p>Any help would be appreciated.</p>