7 个版本 (重大更新)
0.11.0 | 2023 年 11 月 9 日 |
---|---|
0.10.0 | 2023 年 3 月 21 日 |
0.9.0 | 2023 年 1 月 14 日 |
0.8.0 | 2022 年 12 月 12 日 |
0.5.0 | 2022 年 7 月 4 日 |
#1156 in 文本处理
520KB
5.5K SLoC
Pomsky CLI
此 CLI 允许您在命令行中将 ponsky 表达式编译为正则表达式。
使用预构建的二进制文件
二进制文件适用于 Windows、Linux 和 macOS。从 发布页面 下载。
从源代码安装
这需要安装最新的 Rust 工具链。如何安装 Rust 的说明可以在 此处 找到。
使用以下命令安装 CLI
cargo install pomsky-bin
用法
然后您可以将 ponsky 表达式编译为您选择的正则表达式风味;默认为 PCRE。
$ pomsky --help
pomsky 0.1.0
Ludwig Stecher <[email protected]>
Compile pomsky expressions, a new regular expression language
USAGE:
pomsky [OPTIONS] [INPUT]
ARGS:
<INPUT> Pomsky 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 pomsky expression to compile
-V, --version Print version information
它提供友好的错误消息
$ pomsky "'Hello world'* \X+"
Error:
× Backslash escapes are not supported
╭────
1 │ 'Hello world'* \X+
· ─┬
· ╰── error occurred here
╰────
help: Replace `\X` with `Grapheme`
许可证
双许可协议,受 MIT 许可证 或 Apache 2.0 许可证 的约束。
依赖关系
~2–10MB
~102K SLoC