I have a form than when I submit incorrectly no error is displayed

```
    <form action="emailSubs.php" method="post">
        <p>Would you like to subscribe to our newsletter ?</p>
        <p>Name: <input type="text" name="name"><br /></p>
        <p>E-mail: <input type="text" name="Email"><br /></p>
        <p><input type="submit" name="submit"><br /></p>
    </form>
    <?php
    function validateEmail($data, $fieldName) {
        global $errorCount;
        if(empty($data)) {
            echo "\"$fieldName\" is a required
            field.<br />\n";
            ++$errorCount;
            $retval = "";
        } else { // olny clean up the input if it isn't
                // empty
        $retval = trim($data);
        $retval = stripslashes($retval);
        $pattern = "/^[\w-]+(\.[\w-]+)*@" .
             "[\w-]+(\.[\w-]+)*" .
             "(\[[a-z]]{2,})$/i";
    if(preg_match($pattern, $retval) ==0) {
        echo "\"$fieldName\" is not a valid E-mail
        address.<br />\n";
        ++$errorCount;
        }
    }
    return ($retval);
}
    ?>

```

I think it may be the pattern but am not sure what the problem may be