Skip to content

Custom Regex Patterns

Lime Forms supports a shared library of regular expression (regex) patterns that can be reused across Text fields for input validation. Instead of entering the same pattern in every field, you define it once and reference it by name.

Managing patterns

Patterns are managed in Settings → Regex patterns. Each pattern has:

  • Name — A descriptive label shown when selecting the pattern in a field (e.g. "Swedish personal number", "Phone number SE").
  • Pattern — The regular expression itself.
  • Description — Optional notes explaining what the pattern validates.

Using a pattern in a field

When configuring a Text field, select a pattern from the Regex validation dropdown. You can also set a custom error message to show the end user when their input does not match the pattern.

Example patterns

Common use cases for custom regex patterns include:

  • Swedish personal number (personnummer)
  • Phone number formats
  • Postal codes
  • Order reference numbers or custom identifiers