https://github.com/dentosal/reregex
Minimal regex engine
https://github.com/dentosal/reregex
regex-engine
Last synced: 10 months ago
JSON representation
Minimal regex engine
- Host: GitHub
- URL: https://github.com/dentosal/reregex
- Owner: Dentosal
- License: mit
- Created: 2020-08-10T21:17:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-10T21:49:44.000Z (over 5 years ago)
- Last Synced: 2025-01-26T06:24:55.485Z (12 months ago)
- Topics: regex-engine
- Language: Rust
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reregex, yet another minimal regex implementation
Many standard regex features are supported, such as non-greedy matching (e.g. `.*?`), character set ranges (`[a-z]`), alternations (`(a|bb)+`), and graphviz dot-formatted NFA-like diagrams.
Capture groups, Lookarounds and Unicode-aware features are not supported. The engine ins't particularly fast either.
## Example: Visualize regex
```bash
cargo run --example dot -- '-?([1-9][0-9]*)?[13579]' > odd.dot
dot -Tpng odd.dot > odd.png
```

## Example: Grep
```bash
cat README.md | cargo run --example grep -- '`[^`]+`'
```