 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

###

class Simrou
    # Cache regular expressions
    RegExpCache:
        extractHash: /^[^#]*#+(.*)$/
    
    # Does the user's browser natively support the onHashChange event? 
    eventSupported: do ->
        docMode = window.document.documentMode
        'onhashchange' of window and (not docMode? or docMode > 7)
