Regex Entity Extractor
text.extract_entities_regex
Overview
You give us labelled regular expressions and text; we run them on the RE2/J engine, which cannot blow up on backtracking, and hand back every match with its label, its exact value, and its character offsets, ordered by position. Up to 100 patterns per call and 1,000 matches per pattern by default. A pattern that fails to compile is reported as a warning rather than failing your whole call. Accepts file input via file_ref — no need to extract file content first.
LLMs hallucinate regex patterns and miss matches. We execute your patterns with RE2/J for linear-time, offset-annotated, complete results.
Reliability
STRICT and deterministic — identical text and patterns always produce identical matches. RE2/J guarantees linear-time execution without catastrophic backtracking. A pattern with invalid syntax does not fail the call — we skip it and tell you in warnings, so check that array before trusting an empty result. Input validation (not retryable): patterns missing, empty, not an array of objects, or more than 100 entries; neither text nor file_ref; both text and file_ref; text longer than 1,048,576 characters.
Context footprint
Accepts inline text up to ~1M chars or file_ref (up to 2 MB). Upload files via POST /v1/files/upload before passing file_ref. A successful call costs 2 execution credits.
When to use it
When you have known patterns for entities (IDs, emails, codes) and need reliable extraction with position tracking.
Do not use when entities lack known patterns and require semantic understanding, or when you need to validate regex syntax first (use text.validate_regex).
Powered by RE2/J, Google's linear-time regular-expression engine that extracts matches safely without catastrophic backtracking.
Scope
Non-goals
- Does not perform NER or ML-based entity recognition
- Does not infer patterns — you supply every regex
- Does not validate or normalize extracted values beyond the match text
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 1.9 MiB | Skill maximum |
How we handle your data
What this means
This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.
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 may contain submitted or transformed 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.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | No | Bounded inline text source. Required unless file_ref is provided. |
| file_ref | string | No | Tenant-scoped opaque text-file reference. Omit it to use the required inline text; never send both. |
| patterns | array | Yes | Bounded array containing 1 through 100 pattern objects with pattern and label properties. The item shape is defined by the nested schema and the array contains from 1 through 100 items. |
| maxMatchesPerPattern | integer | No | Per-pattern match cap; omit it for one thousand. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| matches | array | Yes | Bounded array of lexical match receipts with label, value, start, and end properties. The item shape is defined by the nested schema and the array contains from 0 through 100000 items. |
| totalMatches | integer | Yes | Returned match count. |
| patternCount | integer | Yes | Evaluated pattern count. |
| warnings | array | Yes | Bounded warning array containing from 0 through 10000 items, where each item is one non-fatal advisory string. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"text.extract_entities_regex","input":{"text":"Contact [email protected] for support.","patterns":[{"pattern":"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}","label":"email"}]}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("text.extract_entities_regex", {"patterns":[{"pattern":"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}","label":"email"},{"pattern":"\\+?1?[-.]?\\(?\\d{3}\\)?[-.]?\\d{3}[-.]?\\d{4}","label":"phone"}],"text":"Please contact support at [email protected] or call +1-555-867-5309 for order issues. Alternatively, reach [email protected] for invoices."});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not perform NER or ML-based entity recognition
- Does not infer patterns — you supply every regex
- Does not validate or normalize extracted values beyond the match text
- Named entity recognition without known patterns
- Semantic entity extraction requiring context understanding
- Complex nested or recursive pattern matching beyond RE2/J limits
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "text.extract_entities_regex",
"input": {
"patterns": [
{
"pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
"label": "email"
},
{
"pattern": "\\+?1?[-.]?\\(?\\d{3}\\)?[-.]?\\d{3}[-.]?\\d{4}",
"label": "phone"
}
],
"text": "Please contact support at [email protected] or call +1-555-867-5309 for order issues. Alternatively, reach [email protected] for invoices."
}
}Examples
Extract emails and phone numbers
{
"patterns": [
{
"pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
"label": "email"
},
{
"pattern": "\\+?1?[-.]?\\(?\\d{3}\\)?[-.]?\\d{3}[-.]?\\d{4}",
"label": "phone"
}
],
"text": "Please contact support at [email protected] or call +1-555-867-5309 for order issues. Alternatively, reach [email protected] for invoices."
}{
"totalMatches": 3,
"patternCount": 2,
"warnings": [],
"matches": [
{
"label": "email",
"value": "[email protected]",
"start": 26,
"end": 39
},
{
"label": "phone",
"value": "+1-555-867-5309",
"start": 48,
"end": 63
},
{
"label": "email",
"value": "[email protected]",
"start": 103,
"end": 119
}
]
}Extract order IDs from logs
{
"patterns": [
{
"pattern": "ORDER-\\d{6}",
"label": "order_id"
}
],
"text": "2026-05-20 Processing ORDER-482917 shipped. 2026-05-21 Refund initiated for ORDER-113042."
}{
"totalMatches": 2,
"patternCount": 1,
"warnings": [],
"matches": [
{
"label": "order_id",
"value": "ORDER-482917",
"start": 22,
"end": 34
},
{
"label": "order_id",
"value": "ORDER-113042",
"start": 76,
"end": 88
}
]
}Recommended use cases
- Extract ticket numbers, order IDs, or internal codes from support text
- Pull email addresses or phone numbers from unstructured messages
- Parse log lines for timestamps, error codes, or request IDs
Avoid for
- Named entity recognition without known patterns
- Semantic entity extraction requiring context understanding
- Complex nested or recursive pattern matching beyond RE2/J limits
Related skills
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.