• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/workflows/H03-May-2022-8675

src/H03-May-2022-601363

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D01-Jan-197074 65

.clog.tomlH A D01-Jan-1970862 2420

.gitignoreH A D01-Jan-1970320 118

CHANGELOG.mdH A D01-Jan-1970825 2712

Cargo.tomlH A D01-Jan-19701 KiB3028

Cargo.toml.orig-cargoH A D01-Jan-1970533 2219

LICENSEH A D01-Jan-19701 KiB2016

README.mdH A D01-Jan-19701.7 KiB3930

README.md

1# matchers
2
3Regular expression matching on Rust streams.
4
5[![Crates.io][crates-badge]][crates-url]
6[![Documentation][docs-badge]][docs-url]
7[![MIT licensed][mit-badge]][mit-url]
8[![CI][ci-badge]][ci-url]
9
10[crates-badge]: https://img.shields.io/crates/v/matchers.svg
11[crates-url]: https://crates.io/crates/matchers
12[docs-badge]: https://docs.rs/matchers/badge.svg
13[docs-url]: https://docs.rs/matchers/0.1.0
14[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
15[mit-url]: LICENSE
16[ci-badge]: https://github.com/hawkw/matchers/actions/workflows/ci.yml/badge.svg
17[ci-url]: https://github.com/hawkw/matchers/actions/workflows/ci.yml
18
19## Overview
20
21The [`regex`] crate implements regular expression matching on strings and byte
22arrays. However, in order to match the output of implementations of `fmt::Debug`
23and `fmt::Display`, or by any code which writes to an instance of `fmt::Write`
24or `io::Write`, it is necessary to first allocate a buffer, write to that
25buffer, and then match the buffer against a regex.
26
27In cases where it is not necessary to extract substrings, but only to test whether
28or not output matches a regex, it is not strictly necessary to allocate and
29write this output to a buffer. This crate provides a simple interface on top of
30the lower-level [`regex-automata`] library that implements `fmt::Write` and
31`io::Write` for regex patterns. This may be used to test whether streaming
32output matches a pattern without buffering that output.
33
34Users who need to extract substrings based on a pattern or who already have
35buffered data should probably use the [`regex`] crate instead.
36
37[`regex`]: https://crates.io/crates/regex
38[`regex-automata`]: https://crates.io/crates/regex-automata
39