Regex validator

Regex

Ingredient Family: validationIngredients

Outline Display: A regex validator that matches {{columnName}} against {{regex}} and shows the message {{message}} on a non-match

Local scope

The parent slot binds these (look up the slot in the parent to see how):

  • $table – The table to validate

Settings

Required

  • columnName : column of $table (type filter: exactly text; required, non-nullable (optional or required))
    The column we’re matching to the regex

  • regex : constant value (type: text; required, non-nullable)
    The regex that this column must match in order to be valid. It runs both as the browser’s JavaScript RegExp and as the server’s POSIX extended regex, so write only what both read the same way: spell out character classes ([0-9], [^@ ]) instead of \d or \s, never put a backslash inside brackets, and give a newline as a literal newline character (a double-quoted YAML “\n”), not an escape. POSIX guarantees repetition bounds only up to 255, so split a larger one, e.g. {0,250}(.|\n){0,250} for at most 500 characters; note such a cap counts bytes on the server and UTF-16 units in the browser.

  • message : constant value (type: text; required, non-nullable)
    A message to display to the user when their text is invalid.