Advanced node type: Input with validation regex

Created by Certorix Online, Modified on Mon, 4 May at 9:29 PM by Certorix Online

Input node validation with regular expressions

Input nodes can validate customer input using regular expressions (regex). This ensures you collect correctly formatted data.

Common validation patterns

  • Email address^[\w.%+-]+@[\w.-]+\.[\w]{2,}$
  • Serial number (format SN-1234-5678)^SN-\d{4}-\d{4}$
  • Phone number (US)^\(\d{3}\) \d{3}-\d{4}$ or ^\+1\d{10}$
  • Order ID (ORD-xxxxx)^ORD-[A-Z0-9]{5}$
  • IP address^(\d{1,3}\.){3}\d{1,3}$
  • Date (YYYY-MM-DD)^\d{4}-\d{2}-\d{2}$
  • ZIP/Postal code (US)^\d{5}(-\d{4})?$
  • Alphanumeric only^[a-zA-Z0-9]*$

Setting up validation

  1. Click the Input node to open properties.
  2. In the Validation pattern field, enter your regex pattern.
  3. In the Validation message field, enter a friendly error message (e.g., 'Please enter a valid email address, like name@example.com').
  4. Toggle Required on if the field is mandatory.
  5. Save the node.

How validation works

When the customer enters text and clicks Continue:

  • The input is tested against the regex pattern.
  • If it matches, the customer proceeds.
  • If it does not match, an error message appears below the input field. The customer cannot proceed until they correct the input.
  • Empty input passes validation only if Required is OFF.

Testing your regex

Use online regex testers (regex101.com) or the console in browser DevTools to test patterns before saving.

Certorix uses JavaScript regex engine (ECMAScript). Features like lookahead/lookbehind are supported.

Example with seral number

Pattern: ^SN-\d{4}-\d{4}$

Validation message: 'Serial number must be in format SN-1234-5678'

Valid: SN-0001-9999, SN-1234-5678

Invalid: SN-123-4567, SN-12345-6789, SN-ABCD-1234

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article