symfony API

sfValidatorRegex Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to API menu


You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfValidatorRegex validates a value with a regular expression.


sfValidatorUrl, sfValidatorEmail  <  sfValidatorRegex  <  sfValidatorString < sfValidatorBase

Method Summary

  • configure($options, $messages)
    Configures the current validator.
  • doClean()
    @see sfValidatorString
  • string getPattern()
    Returns the current validator's regular expression.

Methods inherited from sfValidatorString

configure , doClean

Methods inherited from sfValidatorBase

addMessage , addOption , addRequiredOption , asString , clean , configure , doClean , getCharset , getDefaultMessages , getDefaultOptions , getEmptyValue , getErrorCodes , getMessage , getMessages , getMessagesWithoutDefaults , getOption , getOptions , getOptionsWithoutDefaults , getRequiredOptions , hasOption , isEmpty , setCharset , setDefaultMessage , setDefaultMessages , setDefaultOptions , setMessage , setMessages , setOption , setOptions , __construct

Method Details

  • configure ($options, $messages)

    $options An array of options
    $messages An array of error messages

    Configures the current validator.

    Available options:

    * pattern: A regex pattern compatible with PCRE or {@link sfCallable} that returns one (required)
    * must_match: Whether the regex must match or not (true by default)

  • doClean ()

    @see sfValidatorString

  • (string) getPattern ()

    Returns the current validator's regular expression.