                     matched = true
                 }
             }
-            
+
             if  matched  {
                 // We have some kind of capture for this path element
                 // Build the runtime regex depending on whether or not there is "repetition"

                let range = NSMakeRange(0, path.characters.count)
                guard let keyRegex = namedCaptureRegex else {
                    Log.error("RouteRegex has invalid state: missing keyRegex")
                    return(nil,nil)
                }
                guard let nonKeyRegex = unnamedCaptureRegex else {
                    Log.error("RouteRegex element has invalid state: missing nonKeyRegex")
                    return(nil,nil)
                }
                if let keyMatch = keyRegex.firstMatch(in: path, options: [], range: range) {
                    // We found a path element with a named/key capture

                // A path element with no capture
                regexStr.append("/\(path)")
            }

            return (regexStr, keys, nonKeyIndex, true)
    }
}
