Crate async_regex

Crate async_regex 

Source
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.