safe-regex

crates.io version license: Apache 2.0 unsafe forbidden pipeline status

A safe regular expression library.

Features

Limitations

Alternatives

Cargo Geiger Safety Report

```

Metric output format: x/y x = unsafe code used by the build y = total unsafe code found in the crate

Symbols: 🔒 = No unsafe usage found, declares #![forbid(unsafecode)] ❓ = No unsafe usage found, missing #![forbid(unsafecode)] ☢️ = unsafe usage found

Functions Expressions Impls Traits Methods Dependency

0/0 0/0 0/0 0/0 0/0 🔒 safe-regex 0.2.0 0/0 0/0 0/0 0/0 0/0 🔒 └── safe-regex-macro 0.2.0 0/0 0/0 0/0 0/0 0/0 🔒 ├── safe-proc-macro2 1.0.24 0/0 0/0 0/0 0/0 0/0 🔒 │ └── unicode-xid 0.2.1 0/0 0/0 0/0 0/0 0/0 🔒 └── safe-regex-compiler 0.2.0 0/0 0/0 0/0 0/0 0/0 🔒 ├── safe-proc-macro2 1.0.24 0/0 0/0 0/0 0/0 0/0 🔒 └── safe-quote 1.0.9 0/0 0/0 0/0 0/0 0/0 🔒 └── safe-proc-macro2 1.0.24

0/0 0/0 0/0 0/0 0/0

```

Examples

rust use safe_regex::{regex, IsMatch, Matcher0}; let matcher: Matcher0<_> = regex!(br"[abc][0-9]*"); assert!(matcher.is_match(b"a42")); assert!(!matcher.is_match(b"X"));

rust use safe_regex::{regex, IsMatch, Matcher2}; let matcher: Matcher2<_> = regex!(br"([abc])([0-9]*)"); let (prefix, digits) = matcher.match_all(b"a42").unwrap(); assert_eq!(b"a", prefix.unwrap()); assert_eq!(b"42", digits.unwrap());

Changelog

TO DO

  1. Edit Cargo.toml and bump version number.
  2. Run ../release.sh

License: Apache-2.0