#regex #match #pattern #streaming

matchers

Regex matching on character and byte streams

2 unstable releases

0.1.0 Feb 25, 2021
0.0.1 Aug 2, 2019

#169 in Text processing

Download history 271750/week @ 2022-06-10 302325/week @ 2022-06-17 308956/week @ 2022-06-24 312034/week @ 2022-07-01 328025/week @ 2022-07-08 320807/week @ 2022-07-15 307850/week @ 2022-07-22 330734/week @ 2022-07-29 306350/week @ 2022-08-05 337650/week @ 2022-08-12 315381/week @ 2022-08-19 320275/week @ 2022-08-26 329479/week @ 2022-09-02 330374/week @ 2022-09-09 319044/week @ 2022-09-16 296820/week @ 2022-09-23

1,336,416 downloads per month
Used in 1,220 crates (2 directly)

MIT license

23KB
363 lines

matchers

Regular expression matching on Rust streams.

Crates.io Documentation MIT licensed CI

Overview

The regex crate implements regular expression matching on strings and byte arrays. However, in order to match the output of implementations of fmt::Debug and fmt::Display, or by any code which writes to an instance of fmt::Write or io::Write, it is necessary to first allocate a buffer, write to that buffer, and then match the buffer against a regex.

In cases where it is not necessary to extract substrings, but only to test whether or not output matches a regex, it is not strictly necessary to allocate and write this output to a buffer. This crate provides a simple interface on top of the lower-level regex-automata library that implements fmt::Write and io::Write for regex patterns. This may be used to test whether streaming output matches a pattern without buffering that output.

Users who need to extract substrings based on a pattern or who already have buffered data should probably use the regex crate instead.

Dependencies

~1.5MB
~14K SLoC