converting PHP eregi to preg_match, how do I do it? : <p>I am new to regex but I don't have the time right now to learn it, 
yet I need to convert eregi("^..?$", $file) to a preg_match() but I 
don't know how to do it, can anybody help me?</p>

<p>Also giving me a little understanding of how it works would also be 
nice to have :)</p>

<p>The piece of code:</p>

<pre><code>$fileCount = 0;
while ($file = readdir($dh) and $fileCount &lt; 5){
    if (eregi("^..?$", $file)) {
        continue;
    }
    $open = "./xml/".$file;
    $xml = domxml_open_file($open);

    //we need to pull out all the things from this file that we will need to 
    //build our links
    $root = $xml-&gt;root();
    $stat_array = $root-&gt;get_elements_by_tagname("status");
    $status = extractText($stat_array);

    $ab_array = $root-&gt;get_elements_by_tagname("abstract");
    $abstract = extractText($ab_array);

    $h_array = $root-&gt;get_elements_by_tagname("headline");
    $headline = extractText($h_array);

    if ($status != "live"){
        continue;
    }
    echo "&lt;tr valign=top&gt;&lt;td&gt;";
    echo "&lt;a href=\"showArticle.php?file=".$file . "\"&gt;".$headline . "&lt;/a&gt;&lt;br&gt;";
    echo $abstract;
    echo "&lt;/td&gt;&lt;/tr&gt;";

    $fileCount++;
}
</code></pre>
