PiiCatalog.Match (pii_catalog v0.1.0)

Copy Markdown View Source

One match in a text.

  • name – the pattern that matched, such as :iban.
  • value – the matched bytes. For a pattern that requires a keyword before the value (:format_with_context), the keyword is not part of it.
  • offset – where the match starts, in bytes from the start of the text.
  • length – its length in bytes.

Offsets and lengths are in bytes, not characters, because the patterns match bytewise. binary_part(text, match.offset, match.length) == match.value.

Summary

Types

t()

@type t() :: %PiiCatalog.Match{
  length: non_neg_integer(),
  name: atom(),
  offset: non_neg_integer(),
  value: binary()
}