An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

REXS




CodeFactor


Codecov

Build
Downloads


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)$/`.