Skip to main content

Validating Operator Input with the Pattern Feature

How to use the Pattern setting on a Text input field to enforce a required format, with ready-to-use examples and key things to know.

Written by Alex Merkin

Overview

The Pattern setting on an input field lets you define, in advance, the exact format an operator must enter. Instead of hoping the data is typed correctly, the system checks the input against a pattern you define — preventing typos, inconsistent formats, and values that can't be used later for filtering, routing, or reporting.

If the input doesn't match the pattern, the field is not considered valid and the operator is asked to correct it before continuing. Validation is based on JavaScript regular expressions (Regex).

When to use it

  • When a fixed format is required — serial number, batch/lot number, supplier part number, certificate number, etc.

  • When the entered value will later be used for filtering, routing, or reporting, and an inconsistent format would break the process.

  • When you need an exact length (for example, exactly 6 digits) or a permitted length range.

  • When capturing an email address, phone number, or any other recognizable structure.

How to set up a pattern

  1. When creating or editing an input field, make sure the field is set to the Text subtype.

  2. In the Pattern field, enter the JavaScript regular expression that describes the required format.

  3. Save the field and test it in a running session — try a valid input and an invalid input to confirm the pattern behaves as expected.

Example: to require a 6-digit number, enter ^[0-9]{6}$. Any sequence of 6 digits is accepted; anything else is rejected.

Ready-to-use patterns

You can copy the patterns below directly into the Pattern field and adjust as needed:

What it checks

Pattern

Exactly 5 digits

^[0-9]{5}$

Exactly 6 digits

^[0-9]{6}$

Digits only (any length)

^[0-9]+$

2 letters followed by 4 digits (e.g. AB1234)

^[A-Z]{2}[0-9]{4}$

Letters and digits only, no spaces

^[A-Z0-9]+$

Length between 5 and 10 characters

^.{5,10}$

Starts with "WO-" followed by digits

^WO-[0-9]+$

Phone number: 10 digits starting with 0

^0[0-9]{9}$

Email address

^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$

Things to know

  • Not case-sensitive. The pattern ^[A-Z]$ will accept both uppercase and lowercase letters. If the format must be uppercase only, the Pattern alone will not enforce that.

  • Text subtype only. Pattern is available on the Text subtype of an input field. The Number subtype has no Pattern — there you use Min/Max to restrict the value range.

  • Test before going live. Always test the pattern to confirm it accepts what it should and rejects what it shouldn't.

  • Format, not security. Pattern validates the format only — it is not a security measure. Sensitive data requires additional protection.

  • Format, not existence. Pattern checks the shape of the input, not whether the value exists in a defined list. To validate against a known list, use a Select field or a Lookup against a table instead.

  • Combine with other validation. Pair Pattern with a Required field and with guidance text (Placeholder / Help Text) so operators know the expected format up front.

Did this answer your question?