       Regex.match? %r/foo/, "bar" #=> false
 
   """
-  def match?({ Regex, compiled, _, _, _ }, string) do
+  def match?(regex(re_pattern: compiled), string) do
     :re.run(string, compiled, [{ :capture, :none }]) == :match
   end
 

  @doc """
  Returns the underlying re_pattern in the regular expression.
  """
  def re_pattern({ Regex, compiled, _, _, _ }) do
    compiled
  end


      Regex.replace(%r/(b)/, "abc", "[\\1]") #=> "a[b]c"

  """
  def replace(regex(re_pattern: compiled), string, replacement, options // []) do
    opts   = if options[:global] != false, do: [:global], else: []
    return = options[:return] || return_for(string)
    opts   = [{ :return, return }|opts]
