Skip to main content
transform.regex-extract, Pull named fields from text via regex patterns (deterministic counterpart to ai.extract). Accepts raw text or a parsed-document object; matches carry _evidence.pageIndex when pages are provided.

Configuration

Configuration goes inside the step’s with: block.
input
string | record<string, unknown>
required
Either raw text or a parsed-document object &#123; pages: [&#123; pageIndex, text }] }. Pages enable per-match _evidence.pageIndex.
fields
record<string, object>
required
Named field → pattern mapping.
flags
string
Default regex flags applied when a field omits its own flags. Subset of “gimsuy”.
searchWindow
integer
Only search the first N characters of input (perf). Omit for full search.

Output

Returns record<string, unknown>. Field name → extracted value (or default), plus _evidence: &#123; [field]: &#123; pageIndex, matchOffset, raw } } and _unmatched: string[].