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.1.1 0/0 0/0 0/0 0/0 0/0 🔒 └── safe-regex-macro 0.1.1 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.1.1 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 saferegex::{regex, Matcher}; let re: Matcher<_> = regex!(br"(ab)?c"); asserteq!(None, re.matchall(b"")); asserteq!(None, re.match_all(b"abcX"));

let groups1 = re.matchall(b"abc").unwrap(); asserteq!(b"ab", groups1.group(0).unwrap()); asserteq!(0..2, groups1.grouprange(0).unwrap());

let groups2 = re.matchall(b"c").unwrap(); asserteq!(None, groups2.group(0)); asserteq!(None, groups2.grouprange(0));

// groups2.group(1); // panics ```

Changelog

TO DO

Release Process

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

License: Apache-2.0