Hello,

Can someone show me how to code the following PHP code in Javascript?

PHP Code:
if (eregi("^\[image\].+\[\/image\]$",$answers[$qid][$aid]))
   {
  
$HTML_Ouput .= preg_replace("'\[image\](.+?)\[\/image\]'is","<img \\1 align=middle style=\"margin:4px 4px;\">",ereg_replace(";"," ",$avalue));
  }