       ^(?&ipv4)$
     /x
 
-    Regex.match?(regex, str)
+    Regex.match?(regex, string)
   end
 
   def is_ipv4?(_), do: true
 
   @spec is_ipv6?(any) :: boolean
-  def is_ipv6?(str) when is_binary(str) do
+  def is_ipv6?(string) when is_binary(string) do
     regex = ~r/
       (?(DEFINE)
         (?<h16>(?:[[:xdigit:]]{1,4}) )

      ^(?&sub_domain)(?:\.(?&sub_domain))*$
    /xi

    Regex.match?(regex, str)
  end

  def is_hostname?(_), do: false

  @spec is_ipv4?(any) :: boolean
  def is_ipv4?(str) when is_binary(str) do
    regex = ~r/
      (?(DEFINE)
        (?<dec_octet> (?:25[0-5]|2[0-4]\d|[0-1]?\d{1,2}) )

  end

  @spec is_host?(any) :: boolean
  def is_host?(string) when is_binary(string) do
    is_ipv4?(string) || is_ipv6?(string) || is_hostname?(string)
  end

  def is_host?(_), do: false

  @spec is_uri_userinfo?(any) :: boolean
  def is_uri_userinfo?(string) when is_binary(string) do
    regex = ~r/
      (?(DEFINE)
        (?<pct_encoded> %[[:xdigit:]][[:xdigit:]] )
