Wyrażenie regularne czy pole zawiera 0 lub 1 i ma długość 4

<!DOCTYPE html>
<html>
    <head>
        <title></title>
    </head>
    <body>
        <form action="ostatniprzyklad.php" method="post">
            <input type="text" name="pole">
            <input type="submit" value="wyslij">
        </form>
        <?php
        if (preg_match('@^[01]{4}$@', $_POST['pole'])) {
          echo ('ok');
        } else {
          echo ('error');
        }
        ?>
    </body>
</html>
Komentarze wyłączone