| Crates.io | assert_matches_regex |
| lib.rs | assert_matches_regex |
| version | 0.1.0 |
| created_at | 2024-11-18 04:41:13.17622+00 |
| updated_at | 2024-11-18 04:41:13.17622+00 |
| description | Macro for asserting that a string matches a regex |
| homepage | |
| repository | https://github.com/zertosh/assert_matches_regex |
| max_upload_size | |
| id | 1451773 |
| size | 18,391 |
Provides a macro, assert_matches_regex, which tests whether a string
matches a given regex, causing a panic if it does not match.
[dev-dependencies]
assert_matches_regex = "0.1"
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");