Extension:Page Forms/Input types/Regexp

With the input type regexp you can fine-tune what values are allowed and what is blocked in your input fields. You can even string several filters together to have a cascade of checks, e.g. to give an error message specific to what violation occurred.

The parameters for this input type are:
 * - a Javascript regular expression, which the user input has to match. See Regular Expressions for an introduction to writing a regular expression pattern in JavaScript, and Regex Pal for an interactive testing tool.
 * - the actual input type to display. By default, it is "text", but it can be any other input type as well.
 * - a custom error message to display, when the user input does not pass the validation.
 * - lets you set more than one regexp for this input; see below.

Note that for the regexp, you cannot use the | character because it gets lost in the field definition. If you want to use a pipe, use | instead.

If you want to specify more than one regexp filter, you need to specify a prefix for each filter in the parameter base prefix of its predecessor. Sounds complicated? Have a look at the example below. You may, but do not need to specify a prefix for the final input type - each filter stage consumes only the parameters from the parameter set, that it understands, i.e. the specific parameters listed below.

Examples
A simple text input field accepting only letters, numbers and spaces. (This may be useful for fields from which an article's name is generated in the Page Forms one-step process.)

A text input field accepting only numbers and having no more than 5 digits. Certain numbers are forbidden. Each condition gets its own error message.

Parameters
The following are in addition to the parameters of the specified base input type.