assert_matches_regex

Crates.ioassert_matches_regex
lib.rsassert_matches_regex
version0.1.0
created_at2024-11-18 04:41:13.17622+00
updated_at2024-11-18 04:41:13.17622+00
descriptionMacro for asserting that a string matches a regex
homepage
repositoryhttps://github.com/zertosh/assert_matches_regex
max_upload_size
id1451773
size18,391
Andres Suarez (zertosh)

documentation

https://docs.rs/assert_matches_regex

README

assert_matches_regex

Provides a macro, assert_matches_regex, which tests whether a string matches a given regex, causing a panic if it does not match.

CI Latest version Documentation License

[dev-dependencies]
assert_matches_regex = "0.1"

Example

use assert_matches_regex::assert_matches_regex;

assert_matches_regex!("Hello!", r"(?i)hello");

let data = "deadc0de";
assert_matches_regex!(data, "^[a-f0-9]$", "expected `{data}` to be a hex string");

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 1

cargo fmt