This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 11/4/2026.

Regex

import std/regex

regex.kz · 2 tors · ~[comptime]

match

comptimetransform koru_std/regex.kz:60

~part norm koru_std/regex.norm.kz

Koru Standard Library: the `norm` part of regex.kz. Joined via `~part norm` in regex.kz; merged into the regex module at load. Reads the `:` spec on delivery-arm destructures and normalizes it out of the emission path — `{ l: i64 }` carries the conversion spec in the `:` slot: ident-shaped RHS lands on `path` (the parser can't tell `i64` from a field name), sigil-shaped RHS on `type_text`. Either way it is THIS tor's spec — and the emitted binding must read the payload by capture name (`dst.l`), never `dst.i64`.

~part scan koru_std/regex.scan.kz

Koru Standard Library: the `scan` part of regex.kz. Joined via `~part scan` in regex.kz; merged into the regex module at load. SCAN - unanchored, streaming regex: `!` (each) where match uses `|` (once). `match` finds ONE whole-input match (anchored); `scan` finds EVERY non-overlapping occurrence as an effect stream — it fires its `!` pattern branch per hit (with the same named-group destructure match uses), then runs the optional `| done` continuation once. This is the terminal layer of the parser stack: a lexer in a few lines. Built on the engine's leftmost-longest unanchored search: the compiled SEARCH fn locates each span, and the same captures matcher `match` uses extracts the groups from that span. The `!` branch body is spliced once via `__koru_inline_<idx>` — INSIDE the loop it therefore runs per match, which is exactly effect-branch semantics. Single pattern for now (multi-pattern scan is pinned as a follow-up); pattern branches MUST be effect `!` (dispatch-into-each-match), mirroring the router.

scan

comptimetransform koru_std/regex.scan.kz:20