Class CmsRegexValidator

    • Constructor Summary

      Constructors 
      Constructor Description
      CmsRegexValidator​(java.lang.String regex, java.lang.String message, boolean alwaysAllowEmpty)
      Creates a new regex-based validator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void validate​(I_CmsFormField field, I_CmsValidationController controller)
      If this method is called, the object should either validate the form field and report the result to the validation controller, or request asynchronous validation of the field from the validation controller.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CmsRegexValidator

        public CmsRegexValidator​(java.lang.String regex,
                                 java.lang.String message,
                                 boolean alwaysAllowEmpty)
        Creates a new regex-based validator. The regular expression passed as a parameter is used to match complete strings, not parts of strings. For example, a regex of "AAA" will only match the string "AAA", and not "BAAA". If the regex starts with an exclamation mark ("!"), the match will be inverted, i.e. only strings that don't match the rest of the regular expression will be interpreted as valid.
        Parameters:
        regex - a regular expression
        message - an error message
        alwaysAllowEmpty - if true, the validation will always allow the empty string