Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Regex Validator

text.validate_regex

ProductionEngine wrapper (Class A)Deterministicstrictfastv1.0.0
No network

Overview

You send a pattern; we compile it on the RE2/J engine and tell you whether it is valid, with the parser's own message when it is not. Send sample strings too and we report which ones the pattern finds a match in. We also flag nested quantifiers, which are harmless here but can hang engines that backtrack. Nothing is stored and no text is transformed — this is a check, not an extraction.

Before you deploy a regex, we validate syntax and test samples in a safe linear-time engine so broken patterns fail early.

Reliability

STRICT and deterministic — identical pattern, flags, and samples always yield identical results. RE2/J guarantees linear-time execution with no catastrophic backtracking. A pattern that will not compile is a normal success response with valid: false, not an error, so branch on that field. Input validation (not retryable): pattern missing or not a string; pattern longer than 10,000 characters; samples that is not an array of strings.

Context footprint

No file I/O. Accepts inline pattern and samples only. Provides instant safety verification without LLM regex reasoning. A successful call costs 1 execution credit.

When to use it

When an agent or user submits a regex and you need syntax validation plus sample match verification before production use.

Do not use for high-volume extraction (use text.extract_entities_regex) or PCRE-only features like lookahead and backreferences.

Powered by RE2/J, Google's linear-time regular-expression engine that is immune to catastrophic backtracking.

Scope

Note
Validates regex pattern syntax using RE2/J (safe, no backtracking), detects potential safety issues, and optionally tests the pattern against sample strings. Returns structured results including match status and captured groups per sample.

Non-goals

  • Does not execute regex on production data at scale
  • Does not support PCRE-only features (lookahead, backreferences)
  • Does not replace or transform text — validation and testing only

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

text-processingvalidation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input9.8 KB

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify using a self-contained open-source component
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Self contained open source component
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
patternstringYesRE2/J regular expression to validate.
flagsstringNoOptional RE2/J flag string; omit it for no flags.
samplesarrayNoBounded optional array of sample strings; omit it to perform syntax validation only. The item shape is defined by the nested schema and the array contains from 0 through 1000 items.
enginestringNoRegex engine; omit it for re2j.

Output schema

FieldTypeRequiredDescription
validbooleanYesWhether the regular expression compiled successfully.
enginestringYesApplied regular-expression engine.
syntaxErrorstringNoSafe syntax error when compilation failed.
warningsarrayYesBounded warning array containing from 0 through 10000 items, where each item is one non-fatal advisory string.
sampleResultsarrayYesBounded array of sample-match receipts with sample and matches properties. The item shape is defined by the nested schema and the array contains from 0 through 1000 items.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"text.validate_regex","input":{"pattern":"^[a-z]+$","samples":["hello","WORLD"]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("text.validate_regex", {"pattern":"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$","samples":["[email protected]","invalid@"]});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not execute regex on production data at scale
  • Does not support PCRE-only features (lookahead, backreferences)
  • Does not replace or transform text — validation and testing only
  • Executing regex on large production datasets (use extract_entities_regex instead)
  • Complex PCRE patterns requiring lookahead or backreferences
  • Text replacement or transformation tasks

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "text.validate_regex",
  "input": {
    "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
    "samples": [
      "[email protected]",
      "invalid@"
    ]
  }
}

Examples

Valid email pattern with samples

Inputjson
{
  "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
  "samples": [
    "[email protected]",
    "invalid@"
  ]
}
Expected outputjson
{
  "valid": true,
  "sampleResults": [
    {
      "sample": "[email protected]",
      "matches": true
    },
    {
      "sample": "invalid@",
      "matches": false
    }
  ],
  "warnings": [],
  "engine": "re2j"
}

Invalid syntax

Inputjson
{
  "pattern": "[unclosed"
}
Expected outputjson
{
  "warnings": [],
  "sampleResults": [],
  "valid": false,
  "syntaxError": "error parsing regexp: missing closing ]: `[unclosed`",
  "engine": "re2j"
}
Tip
An unbalanced bracket fails at compile time, so no sample is tested

Nested quantifiers earn a warning, not a rejection

Inputjson
{
  "pattern": "(a+)+b",
  "samples": [
    "aaab"
  ]
}
Expected outputjson
{
  "valid": true,
  "sampleResults": [
    {
      "sample": "aaab",
      "matches": true
    }
  ],
  "warnings": [
    "Pattern contains nested quantifiers — potential backtracking risk"
  ],
  "engine": "re2j"
}
Tip
Safe on RE2/J, which never backtracks, but the same pattern can hang a backtracking engine elsewhere
  • Validate agent-generated regex before deploying to extraction pipelines
  • Pre-flight safety check for user-submitted patterns
  • Test regex against sample strings to verify expected behavior

Avoid for

  • Executing regex on large production datasets (use extract_entities_regex instead)
  • Complex PCRE patterns requiring lookahead or backreferences
  • Text replacement or transformation tasks

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

validationtext