       ^(?&sub_domain)(?:\.(?&sub_domain))*$
     /xi
 
-    Regex.match?(regex, str)
+    Regex.match?(regex, string)
   end
 
   def is_hostname?(_), do: false
 
   @spec is_ipv4?(any) :: boolean
-  def is_ipv4?(str) when is_binary(str) do
+  def is_ipv4?(string) when is_binary(string) do
     regex = ~r/
       (?(DEFINE)
         (?<dec_octet> (?:25[0-5]|2[0-4]\d|[0-1]?\d{1,2}) )

      ^(?:(?&chars)|(?&pct_encoded))*$
    /x

    Regex.match?(regex, str)
  end

  def is_uri_userinfo?(_), do: false

  @spec is_uri_path?(any) :: boolean
  def is_uri_path?(str) when is_binary(str) do
    regex = ~r/
      (?(DEFINE)
        (?<unreserved>  [-._~[:alnum:]] )

      ^(?:(?&rootless)|(?&noscheme)|(?&absolute)|(?&abempty))$
    /x

    Regex.match?(regex, string)
  end

  def is_uri_path?(_), do: false

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