paulmillr/chaplin — comment on commit e3bb07d5ffd597088bfb70af46381bce544a7dae
File: coffee/lib/route.coffee line 23
By molily:

Nice, didn’t know that this is possible in CoffeeScript.

But I think there’s a spare \ in the expression. The compiled JS is `RegExp("^" + pattern + "(?=\\\\?|$)");` but it should be `RegExp("^" + pattern + "(?=\\?|$)");` instead.

So I guess

`///^#{pattern}(?=\\?|$)///`

would suffice.