Regex - Start of String and End of String Anchors For Single Character Clause
Sorry for the NOOB factor but what are these two regi (regex plural lol) doing differently?

http://codepad.viper-7.com/vaQTMh

        <?php

        $name = 'BartSimpson';
        $regex1 = '#^[A-Z]$#i';
        $regex2 = '#[A-Z]#i';


        if (preg_match($regex1, $name)) {
            echo "A match was found.";
        } else {
            echo "A match was not found.";
        }


        if (preg_match($regex2, $name)) {
            echo "A match was found.";
        } else {
            echo "A match was not found.";
        }

        ?>
Regex - Start of String and End of String Anchors For Single Character Clause
===

Sorry for the NOOB factor but what are these two regi (regex plural lol) doing differently?

http://codepad.viper-7.com/vaQTMh

        <?php

        $name = 'BartSimpson';
        $regex1 = '#^[A-Z]$#i';
        $regex2 = '#[A-Z]#i';


        if (preg_match($regex1, $name)) {
            echo "A match was found.";
        } else {
            echo "A match was not found.";
        }


        if (preg_match($regex2, $name)) {
            echo "A match was found.";
        } else {
            echo "A match was not found.";
        }

        ?>