Regex matchers on character and byte streams.
regex crate implements regular expression matching on strings and byte
arrays. However, in order to match the output of implementations of
fmt::Display, or by any code which writes to an instance of
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
regex-automata library that implements
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.
This crate uses the same regex syntax of the
- An error that occurred during the construction of a DFA.
- A reference to a
Patternthat matches a single input.
- A compiled match pattern that can match multipe inputs, or return a
Matcherthat matches a single input.