nx_regex_lib.nx
buildroot/runtime/nx_regex_lib.nx
about
nx_regex_lib.nx -- GENERAL SOVEREIGN REGEX CAPABILITY (shared library). Linear-time NFA matcher (state-set, no
backtracking => ReDoS-IMMUNE, the RE2/Go design). Pure library: no main, no UI. Imports only nx_syscalls.
Subset: literal, '.', '*' '+' '?', '[..]' classes (a-z ranges), '^' '$' anchors. (alternation |/groups () = TODO.)
re_parse(pat,bm,q,fl)->natom re_match(text,tn,bm,q,na,fl,steps)->0/1 re_search(pat,text,tn)->0/1 re_run(pat,text,steps)->0/1
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_regex.nxnx_shell_lib.nx
structs
| none |
consts
| none |
functions
| 7 | func re_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: re_run |
| 8 | func re_setbit(bm: *i64, base: i64, ch: i64) -> i64 { let w: i64=base+(ch>>6); bm[w]=bm[w]|(1<<(ch&63)); return 0 } called by 1: re_parse |
| 9 | func re_getbit(bm: *i64, base: i64, ch: i64) -> i64 { return (bm[base+(ch>>6)]>>(ch&63))&1 } called by 1: re_match |
| 13 | func re_parse(pat: *u8, bm: *i64, q: *i64, fl: *i64) -> i64 |
| 51 | func re_close(set: *i64, q: *i64, na: i64) -> i64 called by 1: re_match |
| 60 | func re_match(text: *u8, tn: i64, bm: *i64, q: *i64, na: i64, fl: *i64, steps: *i64) -> i64 |
| 82 | func re_search(pat: *u8, text: *u8, tn: i64) -> i64 |
| 87 | func re_run(pat: *u8, text: *u8, steps: *i64) -> i64 |