Pattern Match Route in Express/Node

I'm creating a function in a Node/Express application that takes in a request URL and needs to match it with an array of routes (many of which include parameters in the style "/example/user/:userid"). In this function I want to see if, for example, "/example/user/5" matches the express route pattern, similar to how express would do it when resolving routes. I found path-to-regexp on npm which seems to do the job, but is there a function I can call within express instead? My Google-foo has failed me so far.