       )
       ^(?:(?&rootless)|(?&noscheme)|(?&absolute)|(?&abempty))$
     /x
-
-    Regex.match?(regex, string)
-  end
-
-  def uri_template_path?(_), do: false
-
-  @doc """
-  Checks if the value is a valid uri qurey.
-
-  See also `Xema.Format.uri?/1`.
-  """
-  @spec uri_query?(any) :: boolean
-  def uri_query?(string) when is_binary(string) do
-    regex = ~r/
+  @spec uri_template_path?(String.t()) :: boolean
+  def uri_template_path?(string) when is_binary(string),
+    do: Regex.match?(@uri_template_path, string)
+
+  @doc """
+  Checks if the `string` is a valid URI query representation.
+  """
+  @uri_query ~r/
       (?(DEFINE)
         (?<pct_encoded> %[[:xdigit:]][[:xdigit:]] )
         (?<chars>  [-._~[:alnum:]!$&'()*+,;=:@] )

  #

  @doc """
  Checks if the value is a valid date.

  This function returns `true` if the value is a string and is formatted as
  defined by [RFC 3339](https://tools.ietf.org/html/rfc3339), `false` otherwise.
  """
  @spec time?(any) :: boolean
  def date?(string) when is_binary(string),
    do: date_time?("#{string}T00:00:00.0Z")


    end
  end

  defp do_relative_json_pointer?(string) do
    case String.split(string, "/", parts: 2) do
      [pre, pointer] ->
        Regex.match?(~r/^\d+$/, pre) && json_pointer?("/#{pointer}")
