Suggestion on replacing an is_regex call in Elixir -
Can anyone replace me in this alcacer case?
def (archive), element) do r = case collection when is_tuple (c) -> Element (t) c in tuple_to_list when is_list (c) - & gt; Element is in C when is_regex (element) - & gt; Regex.match? (Element, c) when is_bitstring (element) - & gt; String.contains? (C, element) end if (not r), do: message.fail (collection, element, __ENV __. Function) end thanks < P>
You Regex.regex? (Element) .
Comments
Post a Comment