       regex
     end
 
-    string.replace(regex, replacement)
+    string.replace(reg, replacement)
   end
 
   defp do_scan(regex, string, options, results) do

  end

  def opts(regex) do
    regex.flags
  end

  def run(regex, string, options \\ []) do

  end

  defp make_global(regex) do
    if String.contains?(opts(regex), "g") do
      regex
    else
      JS.new(RegExp, [ source(regex), opts(regex) <> "g" ])
