Documentation

This addon is an extension of a Concrete CMS' default attribute called text attribute.

This addon creates a "Text with Regex" attribute, which allows users to set a validation rule using a regular expression. You can use "Text with Regex" at pages, files, users, sites, events, site types and express.

Text with Regex

Added forms

Handle, Name, Set, Searchable and Placeholder Text are available on Concrete CMS's default text attribute. These two forms are added to "Text with Regex."

Regular Expression for Validation

This addon uses FILTER_VALIDATE_REGEXP, which supports PCRE(Perl Compatible Regular Expression). When you enter a regular expression, the delimiters are required.

The regular expression syntax will not be checked. It is assumed that you can check the syntax by yourself.

Error Message when Validation Fails.

You can set your own error-message when validation fails. In this error-message, you can optionally use %1$s and %2$s, %1$s will be converted to the entered text, and %2$s will be converted to the regex for validation.

Warning when validation fails

When validation fails, a warning message will be displayed.

warning on validation fails

Notice

There is a "Required" option for each attribute, configurable on Compose Form. This option is prior to the validation by regular expression.

  • When you do not check "Required," users can leave this area blank.
  • When you check "Required," users cannot leave this area blank, even if the regular expression validation allows.