         return (regex, keys)
     }
 
-    func handlePath(_ path: String, regexStr: String, keys: [String], nonKeyIndex: Int) ->
-        (regexStr: String, keys: [String], nonKeyIndex: Int, status: Bool) {
+    func handlePath(_ path: String, regexStr: String, keys: [String], nonKeyIndex: Int,
+                    keyRegex: NSRegularExpression, nonKeyRegex: NSRegularExpression) ->
+                    (regexStr: String, keys: [String], nonKeyIndex: Int) {
 
             var nonKeyIndex = nonKeyIndex
             var keys = keys

        guard let fromPattern = fromPattern else {
            return (nil, nil)
        }
        var pattern = fromPattern
        var regexStr = "^"
        var keys = [String]()


            // If there was a leading slash, there will be an empty component in the split
            if  path.isEmpty {
                return (regexStr, keys, nonKeyIndex)
            }

            var matched = false
