View Source Moar.Regex (Moar v1.60.0)
Regex-related functions.
Summary
Functions
Returns a single named capture. Can take the first two args in any order.
Like Regex.named_captures/3
but can take the first two args in any order.
Functions
Returns a single named capture. Can take the first two args in any order.
iex> Moar.Regex.named_capture(~r/a(?<foo>b)c(?<bar>d)/, "abcd", "foo")
"b"
iex> Moar.Regex.named_capture("abcd", ~r/a(?<foo>b)c(?<bar>d)/, "foo")
"b"
Like Regex.named_captures/3
but can take the first two args in any order.
iex> Moar.Regex.named_captures(~r/a(?<foo>b)c(?<bar>d)/, "abcd")
%{"bar" => "d", "foo" => "b"}
iex> Moar.Regex.named_captures("abcd", ~r/a(?<foo>b)c(?<bar>d)/)
%{"bar" => "d", "foo" => "b"}