Crates.io | regex-cli-test |
lib.rs | regex-cli-test |
version | 0.1.0 |
source | src |
created_at | 2023-12-28 09:44:57.72769 |
updated_at | 2023-12-28 09:44:57.72769 |
description | A command line tool for testing against regex patterns. |
homepage | https://github.com/Proxxa/regex-cli |
repository | https://github.com/Proxxa/regex-cli |
max_upload_size | |
id | 1082293 |
size | 17,843 |
A simple command line utility for writing regex checks. Currently only matches a full string against
a pattern. Non-matching strings will return an exit code of 1
. Matching strings will return 0
.
Simply use cargo
to install from crates.io.
$ cargo install regex-cli-test
$ if echo -n "a" | regex '\w'
> then
> echo "Matches!"
> fi
Matches!
$ echo -n "\w+" | regex - hello && echo "Matches!"
Matches!
Verbose output is useful for debugging.
$ echo "a" | regex '\w' -v
Raw pattern: \w
Raw haystack: <none provided>
Taking haystack from standard input.
Pattern: \w
Haystack: a
Line terminator: \n
Case ignored? false
Whitespace ignored? false
Dotall? false
Multiline? false
Octal? false
Greed swapped? false
Unicode? true
Haystack does not match the specified pattern.