Skip to content
Myr

Fixed regexp capture keys

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 46a0892 · Browse files · 2 files+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−3 removed

  • tests:+4 added−2 removed
  • other:+2 added−1 removed

2 files+6 added−3 removed

modified:lib/express.core.js+2 added-1 removed
157 unmodified lines
158 },159 160 pathToRegexp : function(path) {161 if (path.constructor == RegExp) return path162 Express.regexpKeys = []163 path = path.replace(/:(\w+)/, function(key){163 (Express.regexpKeys = Express.regexpKeys || []).push(key)164 Express.regexpKeys.push(key)165 return '(.*?)'166 })167 return new RegExp('^' + this.escapeRegexp(path, '/ [ ]') + '$')168 },
144 unmodified lines
modified:spec/spec.routing.js+4 added-2 removed