WHAT
WAHGEX is a regular expression engine that compiles the regex into a WebAssembly (WASM) module instead of executing it directly. The output WASM module can be passed to a variety of engines, such as the Web platform, Wasmtime, or wasmi.
Visit the WAHGEX playground for an example application which uses the WASM modules to execute regex on an input haystack.
This project is still a work in progress, and several features are currently missing:
- Unicode support in lookaround assertions.
- Reporting captures or even offsets of the overall match within the haystack.
- Better library integration with specific WASM engines like Wasmtime or wasmi. Currently, it requires more manual setup.
- Better optimization of the output WASM code.[1]
- Benchmarks...
WHY
Mostly for fun and for the chance to work with tools that interested me. I've been interested in WASM for a while and have a lingering interest in compilers from my time in college. I also used this project as an opportunity to experiment with programming using LLMs, though that part was a middling success.