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 special parameters for this input type are:
 * - a JavaScript regular expression, which the user input has to match. It must include slashes, at the beginning and end. See Regular Expressions for an introduction to writing a regular expression pattern in JavaScript, and Regex Pal for an interactive testing tool. Note that for the regexp, you cannot use the | character because it gets lost in the field definition. See " ", below.
 * - the actual input type to display. By default, it is "text", but it can be any other input type as well.
 * - if set, the input must NOT match the regular expression in order to be valid.
 * - a custom error message to display, when the user input does not pass the validation. Defaults to Wrong format! (or its equivalent in the current locale).
 * - the character that can be used in the regular expression instead of | . Defaults to !.
 * - lets you set more than one regexp for this input; see below.

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.