 class Route
     
     # Cache some static regular expressions - thanks Backbone.js!
-    escapeRegExp: /[-[\]{}()+?.,\\^$|#\s]/g
-    namedParam: /:\w+/g
-    splatParam: /\*\w*/g
-    firstParam: /(:\w+)|(\*\w*)/
+    RegExpCache:
+        escapeRegExp: /[-[\]{}()+?.,\\^$|#\s]/g
+        namedParam: /:\w+/g
+        splatParam: /\*\w*/g
+        firstParam: /(:\w+)|(\*\w*)/
     
     constructor: (@pattern) ->
         if pattern instanceof RegExp

        str = @pattern
        i = 0
        
        while @firstParam.test(str)
            # Get the right replacement
            if values[i]?
                value = if $.isFunction(values[i]) then values[i]() else String(values[i])
            else
                value = ''
            
            str = str.replace(@firstParam, value)
            i++
        
        str

    # Return the current value for window.location.hash without any
    # leading hash keys (does not remove leading slashes!).
    getHash: (url = location.hash) ->
        url.replace(@RegExpCache.extractHash, '$1')
    
    # Takes whatever window.location.hash currently is and tries
    # to resolves that hash.
