rulex-bin

Crates.iorulex-bin
lib.rsrulex-bin
version0.4.5
sourcesrc
created_at2022-03-11 16:33:46.27512
updated_at2022-08-24 19:27:29.963201
descriptionDEPRECATED: Use pomsky-bin instead. Compile rulex expressions, a new regular expression language
homepagehttps://pomsky-lang.org
repositoryhttps://github.com/rulex-rs/pomsky
max_upload_size
id548321
size20,289
Ludwig Stecher (Aloso)

documentation

README

rulex CLI

⚠️ DEPRECATED ⚠️ Use the pomsky-bin crate instead. Rulex was renamed to pomsky.

This CLI allows you to compile rulex expressions to regexes in the command line.

Use pre-built binaries

Binaries are available for Windows, Linux and macOS. Download them from the releases page.

Install from source

This requires that a recent Rust toolchain is installed. Instructions for how to install Rust can be found here.

Install the CLI with

cargo install rulex-bin

Usage

Then you can compile rulex expressions to a regex flavor of your choice; the default is PCRE.

$ rulex --help
rulex 0.1.0
Ludwig Stecher <ludwig.stecher@gmx.de>
Compile rulex expressions, a new regular expression language

USAGE:
    rulex [OPTIONS] [INPUT]

ARGS:
    <INPUT>    Rulex expression to compile

OPTIONS:
    -d, --debug              Show debug information
    -f, --flavor <FLAVOR>    Regex flavor [possible values: pcre, python,
                             java, javascript, dotnet, ruby, rust]
    -h, --help               Print help information
    -p, --path <FILE>        File containing the rulex expression to compile
    -V, --version            Print version information

It provides nice error messages:

$ rulex "'Hello world'* \X+"
Error:
  × Backslash escapes are not supported
   ╭────
 1 │ 'Hello world'* \X+
   ·                ─┬
   ·                 ╰── error occurred here
   ╰────
  help: Replace `\X` with `Grapheme`

License

Dual-licensed under the MIT license or the Apache 2.0 license.

Commit count: 346

cargo fmt