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

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -