 public func ~=<T: RegularExpressionMatchable> (lhs: Regex, rhs: T) -> Bool {
     return rhs.isMatch(regex: lhs)
 }
-
-@inlinable
-public func ==(lhs: Regex, rhs: Regex) -> Bool {
-    return lhs.pattern == rhs.pattern && lhs.options == rhs.options
-}

    public func replace(regex: Regex, template: String) -> String {
        let nsstring = NSString(string: self)
        let range = NSRange(location: 0, length: nsstring.length)
        return regex.matcher.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: template)
    }
}


        let nsstring = NSString(string: self)
        let range = NSRange(location: 0, length: nsstring.length)
        var match_result = [String]()
        regex.regex.enumerateMatches(in: self, options: [], range: range) { result, _, _ in
            if let _result = result {
                match_result.append(nsstring.substring(with: _result.range))
            }
