https://github.com/uellenberg/REXS
A language for writing regular expressions.
https://github.com/uellenberg/REXS
compiler decompiler expression expressions lang language re regex regular regular-expression regular-expressions
Last synced: 9 months ago
JSON representation
A language for writing regular expressions.
- Host: GitHub
- URL: https://github.com/uellenberg/REXS
- Owner: uellenberg
- License: apache-2.0
- Created: 2021-05-24T03:48:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T12:59:45.000Z (almost 3 years ago)
- Last Synced: 2024-11-14T17:47:43.895Z (about 1 year ago)
- Topics: compiler, decompiler, expression, expressions, lang, language, re, regex, regular, regular-expression, regular-expressions
- Language: TypeScript
- Homepage:
- Size: 1.01 MB
- Stars: 133
- Watchers: 2
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - REXS
README
REXS
REXS is a language to create regular expressions. It can be used to create more readable and easy-to-modify expressions that compile to clean and readable regular expressions.
For more information on REXS' syntax (or how to use it), take a look at https://esolangs.org/wiki/REXS.
## Example
An example usage of REXS can be to match on any URL that starts with http:// or https://, then match any subdomains, followed by the domain and .com:
```rexs
assert(START);
match("http");
repeat(0, 1) {
match("s");
}
match("://");
repeat(0, inf, nongreedy) {
repeat(1, inf, nongreedy) {
match(ANY);
}
match(".");
}
group() {
repeat(1, inf, nongreedy) {
match(ANY);
}
match(".com");
}
assert(END);
```
This example will be compiled to `/^https?:\/\/(?:.+?\.)*?(.+?\.com)$/`.