1.0.0 • Published 8 years ago
re-route v1.0.0
re-route
generate regex to match urls with place holder strings. /url/:hi/:foo
generates a regex from a url string. for \/\/\/\/\ sanity
var re = require('./')
var matches = '/a/123/---'.match(compile('/a/:b/:c'))
console.log(matches)
would log this.
[ '/a/123/---', '123', '---', index: 0, input: '/a/123/---' ]
1.0.0
8 years ago