dot-notes v1.0.0 DotNotes.Pattern

This module defines various utilities to do with matching Regex patterns. All are defined here so that they can be compiled once at compile time and then used via common functions.

Summary

Functions

Retrieves the first match of an internal Regex against a given binary

Determines whether a binary matches an internal Regex

Functions

first_match(value, pattern)

Specs

first_match(value :: binary, pattern :: atom) :: match :: binary

Retrieves the first match of an internal Regex against a given binary.

We pull only the first match and unwrap the found value. If no value is found then we return a nil value.

matches?(value, pattern)

Specs

matches?(value :: binary, pattern :: atom) ::
  true |
  false

Determines whether a binary matches an internal Regex.