Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KilianVounckx/roc_regex
Toy regex package for roc
https://github.com/KilianVounckx/roc_regex
Last synced: 3 months ago
JSON representation
Toy regex package for roc
- Host: GitHub
- URL: https://github.com/KilianVounckx/roc_regex
- Owner: KilianVounckx
- Created: 2023-05-29T15:20:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-29T15:34:18.000Z (over 1 year ago)
- Last Synced: 2024-02-11T15:09:35.382Z (9 months ago)
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- roc-awesome - KilianVounckx/roc_regex
README
# Regex
A toy regex implementation in [roc](https://www.roc-lang.org/).
It is far from feature complete, and probably doesn't follow any spec. I am just working on this
to learn about regex, roc and language theory.## What is there
* Regex objects can be parsed from strings as in most programming languages.
* `matches` function which checks if a string matches a regex object (does not return the substring)### Supported regex syntax
* choices (with `|`)
* choice groups (with `[]`)
* grouped regex expressions (with `()`)
* star operator (`*`)
* plus operator (`+`)
* question mark operator (`?`)## Plans
* choice group negation (with `^` in beginning of `[]`)
* range expressions (with `-` in `[]`)
* metacharacters (like `.`, `\d`, `\w`, ...)
* position anchors (like `^` and `$`, `\b`, `\A` and `\Z`, ...)## Non-plans
Some things I explicitly don't want to get into at the moment. This doesn't mean they won't ever
get implemented, but it means it is not something I am interested in right now.* Unicode support (for now only ascii. when not combined with operators, unicode should work)
* State machine (at the moment the implementation uses regex derivatives. to get a more performant
engine, you would need to convert it to a state machine)
* High performance (This is a toy engine so I can learn)