COLLECT layer: an anti-corruption layer over lambdaisland/regal, and the three dialect profiles it can render.
Regal is the emitter we buy rather than build — it owns escaping, precedence and grouping, and it is the only code here that knows what a regex looks like. Its vocabulary does not cross into the domain: it throws, we return a Result; it names flavors, we name dialects.
Measured on 0.1.175: regal does NOT gate on flavor. [:atomic "ab"] renders
as (?>ab) under :ecma, where JavaScript has no atomic groups, and an
unknown flavor is accepted silently. The capability gate in
construct.dialect is therefore load-bearing, not ceremony.
:java every capability flavor :java9 :ecma no atomic groups flavor :ecma :re2 no lookaround, no atomic flavor :ecma (rg, sd, RE2, Rust regex)
:posix-ere is deliberately absent: ERE has no non-capturing group, so
regal's (?:…) output is not ERE even after a capability gate. It needs a
real second emitter, which this design declines to build.
COLLECT layer: an anti-corruption layer over lambdaisland/regal, and the three dialect profiles it can render. Regal is the emitter we buy rather than build — it owns escaping, precedence and grouping, and it is the only code here that knows what a regex looks like. Its vocabulary does not cross into the domain: it throws, we return a Result; it names flavors, we name dialects. ## What regal does not do, and this layer must Measured on 0.1.175: regal does NOT gate on flavor. `[:atomic "ab"]` renders as `(?>ab)` under `:ecma`, where JavaScript has no atomic groups, and an unknown flavor is accepted silently. The capability gate in `construct.dialect` is therefore load-bearing, not ceremony. ## Dialects shipped :java every capability flavor :java9 :ecma no atomic groups flavor :ecma :re2 no lookaround, no atomic flavor :ecma (rg, sd, RE2, Rust regex) `:posix-ere` is deliberately absent: ERE has no non-capturing group, so regal's `(?:…)` output is not ERE even after a capability gate. It needs a real second emitter, which this design declines to build.
Every profile this namespace ships.
Every profile this namespace ships.
JavaScript / ECMAScript. No atomic groups.
JavaScript / ECMAScript. No atomic groups.
The JVM's own engine: java.util.regex.
The JVM's own engine: `java.util.regex`.
(make-emitter profile)An emitter rendering through regal for PROFILE.
An emitter rendering through regal for PROFILE.
RE2 and Rust's regex crate — what rg and sd run. Linear-time by
construction, which is exactly why it has no lookaround and no backrefs.
RE2 and Rust's regex crate — what `rg` and `sd` run. Linear-time by construction, which is exactly why it has no lookaround and no backrefs.
(register-built-in!)Register every built-in profile. Returns the vector of Results.
Register every built-in profile. Returns the vector of Results.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |