Skip to content

silversquirl/rez

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rez

NOTE: rez is currently a work in progress and is missing many important features.

rez is a fast and simple regex engine for Zig. It has extremely consistent speed and memory characteristics, making it a good choice for performance-critical applications.

Performance

Most regex engines are prone to denial of service attacks when accepting user-specified patterns, as they have O(2^n) worst-case time complexity. rez uses an NFA-based matching algorithm, which has O(n) worst-case time complexity, and is hence immune to these attacks.

comptime compilation

For improved performance, regex compilation is performed at comptime. This allows memory usage bounds to be precomputed, meaning matching does not require heap allocation.

Future plans

  • Full regex syntax and capture groups
  • Compile to DFAs instead of NFAs
  • Runtime compilation
  • Compile DFAs to bytecode
  • Compile comptime patterns to machine code

About

Fast, consistent regex engine for Zig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages