1.0.3 • Published 3 years ago

rexs v1.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

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:

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