Module regex_automata::util

source ·
Expand description

A collection of modules that provide APIs that are useful across many regex engines.

While one should explore the sub-modules directly to get a sense of what’s there, here are some highlights that tie the sub-modules to higher level use cases:

  • alphabet contains APIs that are useful if you’re doing low level things with the DFAs in this crate. For example, implementing determinization or walking its state graph directly.
  • captures contains APIs for dealing with capture group matches and their mapping to “slots” used inside an NFA graph. This is also where you can find iterators over capture group names.
  • escape contains types for pretty-printing raw byte slices as strings.
  • iter contains API helpers for writing regex iterators.
  • lazy contains a no-std and no-alloc variant of lazy_static! and once_cell.
  • look contains APIs for matching and configuring look-around assertions.
  • pool provides a way to reuse mutable memory allocated in a thread safe manner.
  • prefilter provides APIs for building prefilters and using them in searches.
  • primitives are what you might use if you’re doing lower level work on automata, such as walking an NFA state graph.
  • syntax provides some higher level convenience functions for interacting with the regex-syntax crate.
  • wire is useful if you’re working with DFA serialization.

Modules§

  • This module provides APIs for dealing with the alphabets of finite state machines.
  • Provides types for dealing with capturing groups.
  • This module contains types and routines for implementing determinization.
  • empty 🔒
    This module provides helper routines for dealing with zero-width matches.
  • Provides convenience routines for escaping raw bytes.
  • int 🔒
    This module provides several integer oriented traits for converting between both fixed size integers and integers whose size varies based on the target (like usize).
  • Provides routines for interpolating capture group references.
  • Generic helpers for iteration of matches from a regex engine in a haystack.
  • A lazily initialized value for safe sharing between threads.
  • Types and routines for working with look-around assertions.
  • memchr 🔒
    This module defines simple wrapper routines for the memchr functions from the memchr crate. Basically, when the memchr crate is available, we use it, otherwise we use a naive implementation which is still pretty fast.
  • A thread safe memory pool.
  • Defines a prefilter for accelerating regex searches.
  • Lower level primitive types that are useful in a variety of circumstances.
  • search 🔒
    Types and routines that support the search APIs of most regex engines.
  • sparse_set 🔒
    This module defines a sparse set data structure. Its most interesting properties are:
  • Provides helpers for dealing with start state configurations in DFAs.
  • Utilities for dealing with the syntax of a regular expression.
  • utf8 🔒
    Utilities for dealing with UTF-8.
  • Types and routines that support the wire format of finite automata.