Expand description
§async-regex
Empower regex with streaming capabilities!
This crate provides high-performance streaming pattern search that leverages the power of regex for pattern matching while adding streaming capabilities for processing large data streams without loading everything into memory.
§Key Features
- Regex-powered pattern matching: Uses the robust
regex
crate for pattern matching - Streaming support: Process data as it arrives without loading everything into memory
- Async and sync APIs: Both async and synchronous versions available
- Multi-byte pattern support: Unlike standard
read_until
which only supports single bytes - Memory efficient: Minimal memory footprint with zero-copy operations where possible
§Why This Crate?
The standard std::io::BufRead::read_until
and tokio::io::AsyncBufRead::read_until
methods
only support single-byte delimiters. This crate extends that functionality to support
multi-byte patterns using regex, making it perfect for parsing protocols, log files,
and other structured data streams.
Constants§
- CRLF
- Carriage Return + Line Feed constant for convenience
Functions§
- find_
pattern - Find a regex pattern in a byte slice.
- read_
until_ pattern - Read from a BufRead stream until a regex pattern is found.
- read_
until_ pattern_ async - Async version of
read_until_pattern
for streaming data. - read_
while_ any - Read from a BufRead stream while any of the specified bytes are found.
- read_
while_ any_ async - Async version of
read_while_any
for streaming data.