sfValidatorEmail.class.php 805 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * sfValidatorEmail validates emails.
  11. *
  12. * @package symfony
  13. * @subpackage validator
  14. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  15. * @version SVN: $Id: sfValidatorEmail.class.php 8835 2008-05-07 16:50:28Z nicolas $
  16. */
  17. class sfValidatorEmail extends sfValidatorRegex
  18. {
  19. /**
  20. * @see sfValidatorRegex
  21. */
  22. protected function configure($options = array(), $messages = array())
  23. {
  24. parent::configure($options, $messages);
  25. $this->setOption('pattern', '/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i');
  26. }
  27. }