Rexen
Compile and evaluate regular expressions using Non-deterministic Finite Automata (NFAs).
Install / Use
/learn @tonievictor/RexenREADME
rexen
gleam add rexen
import rexen
pub fn main() {
let assert Ok(nfa) = rexen.new("(ab)*")
rexen.compute(nfa, "ab") // -> True
rexen.compute(nfa, "ababab") // -> True
rexen.compute(nfa, "ababa") // -> False
rexen.compute(nfa, "a") // -> False
}
Features
Rexen supports a core set of regular expression operations, including:
| Operator | Description | Expression | Matches |
| -------- | ----------- | ---------- | ------- |
| * | Zero or more of the preceding character or group of characters | a* | "", "a", "aa" "aaa" |
| + | One or more of the preceding character or group of characters | a+ | "a", "aa", "aaa" |
| ? | Zero or one of the preceding character or group of characters | a? | "", "a" |
| \| | Matches either the expression before or after the operator | a\|b | "a", "b" |
| () | Groups characters or expressions | (ab)+ | "ab", "abab", "ababab" |
Note: Concatenation is implicit in rexen. ie the expression
abcmatchesafollowed bybandc- "abc"
Further documentation can be found at https://hexdocs.pm/rexen.
Development
gleam test # Run the tests
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
