       Regex.source %r(foo) #=> "foo"
 
   """
-  def source({ Regex, _, source, _, _ }) do
+  def source(regex(source: source)) do
     source
   end
 


  def split(regex, string, options // [])

  def split({ Regex, compiled, _, _, _ }, string, options) do
    parts =
      cond do
        options[:global] == false -> 2

      Regex.index %r/e/, "abcd"     #=> nil

  """
  def index(regex(re_pattern: compiled), string) do
    case :re.run(string, compiled, [{ :capture, :first, :index }]) do
      :nomatch -> nil
      { :match, [{index,_}] } -> index
