2 unstable releases

0.1.0 Feb 25, 2021
0.0.1 Aug 2, 2019

#694 in Text processing

Download history 620395/week @ 2023-11-20 712901/week @ 2023-11-27 710338/week @ 2023-12-04 764069/week @ 2023-12-11 695377/week @ 2023-12-18 359866/week @ 2023-12-25 627088/week @ 2024-01-01 800422/week @ 2024-01-08 822016/week @ 2024-01-15 832735/week @ 2024-01-22 909253/week @ 2024-01-29 912867/week @ 2024-02-05 952831/week @ 2024-02-12 911829/week @ 2024-02-19 987389/week @ 2024-02-26 986770/week @ 2024-03-04

3,893,728 downloads per month
Used in 4,008 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

~2.5MB
~27K SLoC