Stdlib module regex.vitl

This page is a wiki-style reference for one concrete stdlib file. It explains what the file owns, where it fits in the family, and how to decide whether this is the right surface to depend on.

Visual portrait of regex.vitl
Wiki-style portrait for regex.vitl.

Family: stdlib

Kind: public stdlib surface

Page style: this reference follows the same “encyclopedic card + portrait + usage contract” logic as the keyword pages, but for stdlib modules.

Summary

Overview

FieldValue
Pathregex.vitl
Familystdlib
Kindpublic stdlib surface
Line count320
Declared procedures44
Declared forms/picks9

`regex.vitl` is a public stdlib surface inside the `stdlib` family. It should be read as one focused slice of the broader family responsibility: Top-level map of the Vitte standard library and the responsibilities owned by each family.

Purpose

This file should be chosen because of responsibility, not because its name “sounds close enough”. Inside the stdlib family, it carries one focused part of the contract and keeps that responsibility separate from neighboring concerns.

  • Domain values start in `core` and `strings`.
  • Grouped data moves through `collections` or `data`.
  • Structured export goes through `json` and `encoding`.
  • Filesystem or process interaction goes through `path`, `io`, `os`, or `sysinfo`.
  • Explicit runtime coordination goes through `async`, `threading`, `kernel`, or `ffi`.

Taxonomy

Think of this page as a generated encyclopedia entry rather than a hand-written tutorial. The goal is to show what kind of module this is, how dense it is, and what reading strategy makes sense before depending on it.

  • Large algorithm surface: this file exposes many procedures and likely acts as a domain toolkit rather than a single thin wrapper.
  • Owns domain vocabulary: the module declares data shapes in addition to executable helpers, so its types are part of the contract.
  • Has tuning constants: part of the module behavior is controlled by named constants that document default precision, limits, or policy.
  • Minimal top-level dependencies: the module reads as mostly self-contained from its opening declarations.
  • Explicit export surface: the file ends with visible export declarations instead of relying only on implicit namespace discovery.

Implementation profile

This profile is inferred directly from the source text. It does not replace reading the file, but it tells you quickly whether the module is mostly declarative, loop-heavy, branch-heavy, or organized around many small exits.

SignalCountWhat it suggests
if1Branching density and local decision-making.
while0Loop-heavy or iterative implementation style.
for0Collection-style traversal at source level.
match0Variant-driven branching or grammar-style decoding.
let2Local state and intermediate value density.
give45Number of explicit exit points and result shaping.

Top-level API inventory

SurfaceItems
Proceduresregex_version, regex_name, regex_module_count, regex_modules, regex_manifest, regex_ready, regex_health, regex_summary, regex_selftest, regex_compile, regex_compile_flags, regex_is_valid
FormsRegex, Match, MatchResult, RegexLibraryManifest, RegexLibraryHealth, RegexLibrarySummary, RegexParseReport, RegexMatchReport, RegexReplaceReport
Picksnone declared at top level
ConstantsREGEX_EMAIL, REGEX_URL, REGEX_IPV4, REGEX_IPV6, REGEX_PHONE, REGEX_DATE, REGEX_TIME, REGEX_UUID, REGEX_CREDIT_CARD
Exports*

Imported surfaces

This file does not advertise a top-level `use` surface in its opening declarations. That often means it is either self-contained or an aggregation layer.

Position in family

This file is module 12 of 15 in the stdlib family when ordered by path. By procedure count it ranks 7, and by line count it ranks 8. Those ranks are useful as rough signals of breadth, not as quality judgments.

Declaration map

The declaration map turns raw source into a scan-friendly catalog. It is useful when the file is large enough that a reader wants to orient by kinds of surfaces first.

LineNameKindRole
1vitte/regexspaceDeclares the namespace that anchors this file in the stdlib tree.
7RegexformIntroduces a structured data shape that other procedures can exchange.
13MatchformIntroduces a structured data shape that other procedures can exchange.
20MatchResultformIntroduces a structured data shape that other procedures can exchange.
25RegexLibraryManifestformIntroduces a structured data shape that other procedures can exchange.
31RegexLibraryHealthformIntroduces a structured data shape that other procedures can exchange.
39RegexLibrarySummaryformIntroduces a structured data shape that other procedures can exchange.
44RegexParseReportformIntroduces a structured data shape that other procedures can exchange.
50RegexMatchReportformIntroduces a structured data shape that other procedures can exchange.
57RegexReplaceReportformIntroduces a structured data shape that other procedures can exchange.
64regex_versionprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
68regex_nameprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
72regex_module_countprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
76regex_modulesprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
85regex_manifestprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
93regex_readyprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
97regex_healthprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
107regex_summaryprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
114regex_selftestprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
122regex_compileprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
130regex_compile_flagsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
138regex_is_validprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
142regex_matchprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
146regex_match_atprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
150regex_findprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
159regex_find_allprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
167regex_get_groupprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
174regex_group_countprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
179regex_replaceprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
183regex_replace_firstprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
187regex_replace_allprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
192regex_splitprocOwns path semantics, traversal, or normalization.
196regex_split_limitprocOwns path semantics, traversal, or normalization.
201regex_testprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
205regex_test_atprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
210regex_escapeprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
214regex_create_patternprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
219str_matchesprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
223str_matches_atprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
227str_find_matchprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
236str_find_all_matchesprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
243str_replace_regexprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
247str_split_regexprocOwns path semantics, traversal, or normalization.
252REGEX_EMAILconstDefines a named constant reused across the module.
253REGEX_URLconstDefines a named constant reused across the module.
254REGEX_IPV4constDefines a named constant reused across the module.
255REGEX_IPV6constDefines a named constant reused across the module.
256REGEX_PHONEconstDefines a named constant reused across the module.
257REGEX_DATEconstDefines a named constant reused across the module.
258REGEX_TIMEconstDefines a named constant reused across the module.
259REGEX_UUIDconstDefines a named constant reused across the module.
260REGEX_CREDIT_CARDconstDefines a named constant reused across the module.
262is_emailprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
266is_urlprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
270is_ipv4procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
274is_ipv6procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
278is_phoneprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
282is_dateprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
286is_timeprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
290is_uuidprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
294regex_parse_reportprocTransforms an input representation into a structured internal value.
303regex_match_reportprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
312regex_replace_reportprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.

The table is exhaustive for top-level declarations of the selected kinds. This file declares 63 matching surfaces.

Representative signatures

These signatures are shown in source order so the page keeps the feel of a reference manual, not just a keyword cloud.

  • form Regex { (line 7)
  • form Match { (line 13)
  • form MatchResult { (line 20)
  • form RegexLibraryManifest { (line 25)
  • form RegexLibraryHealth { (line 31)
  • form RegexLibrarySummary { (line 39)
  • form RegexParseReport { (line 44)
  • form RegexMatchReport { (line 50)
  • form RegexReplaceReport { (line 57)
  • proc regex_version() -> string { (line 64)
  • proc regex_name() -> string { (line 68)
  • proc regex_module_count() -> i32 { (line 72)
  • proc regex_modules() -> [string] { (line 76)
  • proc regex_manifest() -> RegexLibraryManifest { (line 85)
  • proc regex_ready() -> bool { (line 93)
  • proc regex_health() -> RegexLibraryHealth { (line 97)
  • proc regex_summary() -> RegexLibrarySummary { (line 107)
  • proc regex_selftest() -> bool { (line 114)

The list is intentionally capped here; the source file declares 62 matching signatures in total.

How to use this module

Start by reading the file as an ownership boundary. Ask three questions: what enters this module, what stable types or procedures it exports, and what adjacent module should stay outside of it.

  1. Read space and top-level imports first so the ownership boundary of regex.vitl is explicit.
  2. Scan constants before procedures; they often encode precision, limits, or policy assumptions that explain later behavior.
  3. Read declared forms and picks before algorithms so the data vocabulary is stable in your head.
  4. Traverse procedures in source order; the early helpers usually explain the naming and numeric conventions used later.
  5. Use the source landmarks section below as a table of contents when the file is large.

User example

This example is generated from the actual stdlib module surface. Its job is not to be the smallest snippet possible; its job is to show a realistic consumer-shaped file that exercises the module and mirrors the language keywords the module itself relies on.

space demo/regex
form DemoState {
  ready: bool,
  note: string
}
proc run_example() -> DemoState {
  let ready: bool = regex_ready()
  if not ready {
    give DemoState { ready: false, note: "not-ready" }
  } else {
    give DemoState { ready: true, note: "ok" }
  }
}
export run_example

Keyword coverage

This table makes the “all keywords of the module” requirement auditable. It compares the detected Vitte keywords in the source file with the generated consumer example above.

KeywordPresent in module sourceUsed in generated user example
spaceyesyes
constyesno
formyesyes
procyesyes
letyesyes
ifyesyes
giveyesyes
exportyesyes
trueyesyes
andyesno

Keywords still not exercised directly in the generated snippet: const, and. The page still lists them here so the gap is visible.

Source shape

space vitte/regex
form Regex {
    pattern: string,
    flag_bits: i32,
    compiled: i64
}
form Match {
    matched: int,
    start: i32,
    end: i32,

The excerpt is not meant to replace the file. It exists to make the module recognizable at first glance, the same way a Wikipedia infobox helps the reader orient before reading the whole article.

Source landmarks

Large files are easier to retain when they have visible landmarks. When the source contains explicit section banners, they are surfaced here; otherwise the first major declarations are used as anchors.

  • Regular Expression Library — Pattern matching and replacement

Source organization

When a file carries its own internal chaptering, those chapters usually reveal the intended reading order better than a flat symbol list. This section reconstructs that organization from the source itself.

Opening declarations

Top-level items: 1. Procedures: 0. Data surfaces: 0. Constants: 0.

First visible names: vitte/regex

Regular Expression Library — Pattern matching and replacement

Top-level items: 63. Procedures: 44. Data surfaces: 9. Constants: 9.

First visible names: Regex, Match, MatchResult, RegexLibraryManifest, RegexLibraryHealth, RegexLibrarySummary, RegexParseReport, RegexMatchReport, RegexReplaceReport, regex_version

Complete API catalog

This catalog is the exhaustive file-level index for the module. It is intentionally closer to a generated encyclopedia appendix than to a tutorial summary.

Constants

LineNameSignatureRole
252REGEX_EMAILconst REGEX_EMAIL: string = ""Defines a named constant reused across the module.
253REGEX_URLconst REGEX_URL: string = ""Defines a named constant reused across the module.
254REGEX_IPV4const REGEX_IPV4: string = ""Defines a named constant reused across the module.
255REGEX_IPV6const REGEX_IPV6: string = ""Defines a named constant reused across the module.
256REGEX_PHONEconst REGEX_PHONE: string = ""Defines a named constant reused across the module.
257REGEX_DATEconst REGEX_DATE: string = ""Defines a named constant reused across the module.
258REGEX_TIMEconst REGEX_TIME: string = ""Defines a named constant reused across the module.
259REGEX_UUIDconst REGEX_UUID: string = ""Defines a named constant reused across the module.
260REGEX_CREDIT_CARDconst REGEX_CREDIT_CARD: string = ""Defines a named constant reused across the module.

Data surfaces

LineNameSignatureRole
7Regexform Regex {Introduces a structured data shape that other procedures can exchange.
13Matchform Match {Introduces a structured data shape that other procedures can exchange.
20MatchResultform MatchResult {Introduces a structured data shape that other procedures can exchange.
25RegexLibraryManifestform RegexLibraryManifest {Introduces a structured data shape that other procedures can exchange.
31RegexLibraryHealthform RegexLibraryHealth {Introduces a structured data shape that other procedures can exchange.
39RegexLibrarySummaryform RegexLibrarySummary {Introduces a structured data shape that other procedures can exchange.
44RegexParseReportform RegexParseReport {Introduces a structured data shape that other procedures can exchange.
50RegexMatchReportform RegexMatchReport {Introduces a structured data shape that other procedures can exchange.
57RegexReplaceReportform RegexReplaceReport {Introduces a structured data shape that other procedures can exchange.

Procedures

LineNameSignatureRole
64regex_versionproc regex_version() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
68regex_nameproc regex_name() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
72regex_module_countproc regex_module_count() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
76regex_modulesproc regex_modules() -> [string] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
85regex_manifestproc regex_manifest() -> RegexLibraryManifest {Represents one top-level surface in the file contract and should be read as part of the module boundary.
93regex_readyproc regex_ready() -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
97regex_healthproc regex_health() -> RegexLibraryHealth {Represents one top-level surface in the file contract and should be read as part of the module boundary.
107regex_summaryproc regex_summary() -> RegexLibrarySummary {Represents one top-level surface in the file contract and should be read as part of the module boundary.
114regex_selftestproc regex_selftest() -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
122regex_compileproc regex_compile(pattern: string) -> Regex {Represents one top-level surface in the file contract and should be read as part of the module boundary.
130regex_compile_flagsproc regex_compile_flags(pattern: string, flag_bits: i32) -> Regex {Represents one top-level surface in the file contract and should be read as part of the module boundary.
138regex_is_validproc regex_is_valid(pattern: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
142regex_matchproc regex_match(re: Regex, text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
146regex_match_atproc regex_match_at(re: Regex, text_value: string, pos: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
150regex_findproc regex_find(re: Regex, text_value: string) -> Match {Represents one top-level surface in the file contract and should be read as part of the module boundary.
159regex_find_allproc regex_find_all(re: Regex, text_value: string) -> MatchResult {Represents one top-level surface in the file contract and should be read as part of the module boundary.
167regex_get_groupproc regex_get_group(m: Match, group: i32) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
174regex_group_countproc regex_group_count(m: Match) -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
179regex_replaceproc regex_replace(re: Regex, text_value: string, replacement: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
183regex_replace_firstproc regex_replace_first(re: Regex, text_value: string, replacement: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
187regex_replace_allproc regex_replace_all(re: Regex, text_value: string, replacement: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
192regex_splitproc regex_split(re: Regex, text_value: string) -> [string] {Owns path semantics, traversal, or normalization.
196regex_split_limitproc regex_split_limit(re: Regex, text_value: string, limit: i32) -> [string] {Owns path semantics, traversal, or normalization.
201regex_testproc regex_test(re: Regex, text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
205regex_test_atproc regex_test_at(re: Regex, text_value: string, pos: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
210regex_escapeproc regex_escape(text_value: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
214regex_create_patternproc regex_create_pattern(parts: [string], separator: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
219str_matchesproc str_matches(text_value: string, pattern: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
223str_matches_atproc str_matches_at(text_value: string, pattern: string, pos: i32) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
227str_find_matchproc str_find_match(text_value: string, pattern: string) -> Match {Represents one top-level surface in the file contract and should be read as part of the module boundary.
236str_find_all_matchesproc str_find_all_matches(text_value: string, pattern: string) -> MatchResult {Represents one top-level surface in the file contract and should be read as part of the module boundary.
243str_replace_regexproc str_replace_regex(text_value: string, pattern: string, replacement: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
247str_split_regexproc str_split_regex(text_value: string, pattern: string) -> [string] {Owns path semantics, traversal, or normalization.
262is_emailproc is_email(text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
266is_urlproc is_url(text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
270is_ipv4proc is_ipv4(text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
274is_ipv6proc is_ipv6(text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
278is_phoneproc is_phone(text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
282is_dateproc is_date(text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
286is_timeproc is_time(text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
290is_uuidproc is_uuid(text_value: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
294regex_parse_reportproc regex_parse_report(pattern: string) -> RegexParseReport {Transforms an input representation into a structured internal value.
303regex_match_reportproc regex_match_report(pattern: string, text: string) -> RegexMatchReport {Represents one top-level surface in the file contract and should be read as part of the module boundary.
312regex_replace_reportproc regex_replace_report(pattern: string, text: string) -> RegexReplaceReport {Represents one top-level surface in the file contract and should be read as part of the module boundary.

Exports

LineNameSignatureRole
320*export *Re-exports surfaces that the module wants to expose as part of its public boundary.

Integration boundaries

Within stdlib, this file should remain focused. If a future helper changes the host boundary, scheduling boundary, or data-shape boundary, it probably belongs in a neighbor module instead of being added here by convenience.

  • Family responsibility: Top-level map of the Vitte standard library and the responsibilities owned by each family.
  • Family architecture role: A realistic Vitte program usually starts in `core`, grows through `collections` or `data`, crosses textual boundaries with `json` or `encoding`, touches the host with `path` or `io`, and only then reaches system-facing families like `kernel`, `ffi`, `async`, or `threading`.

Composition guidance

Choose this module when

  • Choose regex.vitl when the main question is owned by this module rather than by transport, storage, orchestration, or user-interface code.
  • Domain values start in `core` and `strings`.
  • Grouped data moves through `collections` or `data`.
  • Structured export goes through `json` and `encoding`.
  • Filesystem or process interaction goes through `path`, `io`, `os`, or `sysinfo`.
  • Explicit runtime coordination goes through `async`, `threading`, `kernel`, or `ffi`.

Pause before extending it when

  • Avoid extending this file when the new helper mostly changes the boundary to host I/O, runtime coordination, or foreign integration instead of staying inside stdlib.
  • Check nearby modules such as GETTING_STARTED.vitl, core_alias.vitl, datetime.vitl before adding convenience wrappers here.

Relationship table

This table keeps the page closer to a real encyclopedia entry: a module is easier to understand when compared with its nearest alternatives in the same family.

NeighborProceduresData surfacesWhy compare it
GETTING_STARTED.vitl260Shares the same family boundary but carries a distinct slice of responsibility.
core_alias.vitl00Shares the same family boundary but carries a distinct slice of responsibility.
datetime.vitl13816Shares the same family boundary but carries a distinct slice of responsibility.
graphics.vitl50Shares the same family boundary but carries a distinct slice of responsibility.
memory.vitl13716Shares the same family boundary but carries a distinct slice of responsibility.
mod.vit162Shares the same family boundary but carries a distinct slice of responsibility.
network/http.vitl42Shares the same family boundary but carries a distinct slice of responsibility.
network/socket.vitl52Shares the same family boundary but carries a distinct slice of responsibility.

Neighbor modules