 //
 //  regex.swift
-//  unchained
+//  SwiftyRegex
 //
 //  Created by Johannes Schriewer on 06/12/15.
 //  Copyright © 2015 Johannes Schriewer. All rights reserved.
 //
 
-import Foundation
 import pcre2
 
+/// internal extension to convert a string to an integer array
 extension SequenceType where Generator.Element == UInt8 {
     static func fromString(string: String) -> [UInt8] {
         var temp = [UInt8]()

    }
}

public class RegEx {
    private let compiled: COpaquePointer
    
    enum Error: ErrorType {
        case InvalidPattern(errorOffset: Int, errorMessage: String)
    }
    
    public init(pattern: String) throws {
        let tmp = [UInt8].fromString(pattern)
        

        pcre2_code_free_8(self.compiled)
    }
    
    /// Match a string against the pattern
    ///
    /// - parameter string: the string to match
    /// - returns: tuple with matches, named parameters are returned as numbered matches too
    public func match(string: String) -> (numberedParams:[String], namedParams:[String:String]) {
        let match_data = pcre2_match_data_create_from_pattern_8(self.compiled, nil)
        defer {
