Crate hexagex

source ·
Expand description

Transforms a hexagex – a regex written using hexadecimal – into a regex matching on the binary data.

The syntax is mostly the same as in the regex crate, but the literals have been replaced:

  • 0-9, a-f: 4-bits sequences interpreted as base 16 numbers
  • .: 4-bit wildcard
  • O, I: 1-bit value corresponding to 0 and 1
  • _: 1-bit wildcard
  • ^, $: these match the start and end of the text, not of the line
  • \t: this is an escape to interprete the content immediately after it into a non-hexagex regular regex

Repetitions (* etc.), alternations (a | b) and groups ((a)) require their inner expressions to have a multiple of bits, otherwise an error is generated. Classes like [1-e] require all their elements to have the same number of bits.

Modules§

  • Search for regex matches in &[u8] haystacks.

Enums§

  • An error from either the hexagex transformation process or the regex compilation itself

Functions§

  • Convert the hexagex given in hexagex into a regex from regex::bytes you can use to match.