                             keys.append(path.bridge().substring(with: keyMatch.range(at: 2)))
                             matched = true
                         }
-                        else if  let nonKeyMatch = RouterElement.nonKeyRegex!.firstMatch(in: path, options: [], range: range) {
+                        else if  let nonKeyMatch = RouterElement.nonKeyRegex?.firstMatch(in: path, options: [], range: range) {
                             // We found a path element with an unnamed capture
                             let prefixRange = nonKeyMatch.range(at: 1)
                             if  prefixRange.location != NSNotFound  &&  prefixRange.location != -1  {

                            keys.append(path.bridge().substringWithRange(keyMatch.rangeAtIndex(2)))
                            matched = true
                        }
                        else if  let nonKeyMatch = RouterElement.nonKeyRegex!.firstMatchInString(path, options: [], range: range) {
                            // We found a path element with an unnamed capture
                            let prefixRange = nonKeyMatch.rangeAtIndex(1)
                            if  prefixRange.location != NSNotFound  &&  prefixRange.location != -1  {

    /// - Parameter response: the response
    ///
    func process(request: RouterRequest, response: RouterResponse, next: () -> Void) {
        guard let urlPath = request.parsedUrl.path else {
            Log.error("Failed to process request")
            return
        }

        if response.error == nil || method == .Error {
            if response.error != nil || method == .All || method == request.method {
                // Either response error exists and method is error, or method matches
                if  let regex = regex  {
#if os(Linux)
                    let tempMatch = regex.firstMatchInString(urlPath, options: [], range: NSMakeRange(0, urlPath.characters.count))
#else
                    let tempMatch = regex.firstMatch(in: urlPath, options: [], range: NSMakeRange(0, urlPath.characters.count))
#endif
                    if  let match = tempMatch  {
#if os(Linux)
                    request.matchedPath = urlPath.bridge().substringWithRange(match.range)
#else
                    request.matchedPath = urlPath.bridge().substring(with: match.range)
