3 releases (breaking)

0.2.0 Jul 1, 2024
0.1.0 Feb 25, 2021
0.0.1 Aug 2, 2019

#55 in Text processing

Download history 1147402/week @ 2024-07-23 1145117/week @ 2024-07-30 1168559/week @ 2024-08-06 1172214/week @ 2024-08-13 1214291/week @ 2024-08-20 1153238/week @ 2024-08-27 1277307/week @ 2024-09-03 1217368/week @ 2024-09-10 1173483/week @ 2024-09-17 1296583/week @ 2024-09-24 1310396/week @ 2024-10-01 1307064/week @ 2024-10-08 1405767/week @ 2024-10-15 1437044/week @ 2024-10-22 1359218/week @ 2024-10-29 1155138/week @ 2024-11-05

5,563,699 downloads per month
Used in 6,512 crates (2 directly)

MIT license

23KB
317 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–3MB
~53K SLoC