Regex.Spec behaviour (regex_spec v0.21.38)
Provides typed regular expressions for your Elixir application.
Use in your module to define the return type of your regular expression functions.
Link to this section Summary
Callbacks
Returns a boolean indicating whether there was a match or not.
The original compiled Regular Expression.
Runs the regular expression against the given string until the first match.
It returns a list with all captures or nil if no match occurred.
See Regex.run/3
Runs the regular expression against the given string until the first match.
It returns a list of byte index and match length or nil if no match occurred.
See Regex.run/3
with [return: :index]
option.
Link to this section Callbacks
match?(s)
Specs
match?(s :: binary()) :: bool()
Returns a boolean indicating whether there was a match or not.
See Regex.match?/2
regex()
Specs
regex() :: Regex.t()
The original compiled Regular Expression.
run(s)
Specs
Runs the regular expression against the given string until the first match.
It returns a list with all captures or nil if no match occurred.
See Regex.run/3
run_indicies(s)
Specs
Runs the regular expression against the given string until the first match.
It returns a list of byte index and match length or nil if no match occurred.
See Regex.run/3
with [return: :index]
option.