Regex.required.prefix: def of bend-kit-regex@0.8.0.0 Import: import bend-kit-regex@0.8.0.0/regex.bend as Regex Lines 577-589 of bend-kit-regex@0.8.0.0/regex.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-regex@0.8.0.0/regex.bend&start_line=577&end_line=589 import Base # The first iteration contains the selected literal; every occurrence is inspected. def required.prefix(n: Node) -> Maybe<&2, Node>: match n: case NSet{False{}, Con{Rng{+lo, +hi}, Nil{}}}: Bool.pick(Maybe<&2, Node>, U32.is_eq(lo, hi) && U32.is_lt(lo, 128), Some{lit(lo)}, None{}) case NCat{+a, b}: required.join(required.prefix(b), required.prefix(a), a) case NPlus{g, a}: required.prefix(a) case NGroup{i, a}: required.prefix(a) case _: None{} Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=bend-kit-regex@0.8.0.0/regex.bend&name=Item https://jend.leeeet.dev/definition.txt?path=bend-kit-regex@0.8.0.0/regex.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bend-kit-regex@0.8.0.0/regex.bend&name=lit https://jend.leeeet.dev/definition.txt?path=bend-kit-regex@0.8.0.0/regex.bend&name=required.join