Returns parse route object.
parseRoute(route)

route | string dynamic route

Returns object.

#### Description

The route argument is a string, for example: w2utils.parseRoute('/view/(:id)/details/:sub'); Returns route = { path: /^\/view(?:\/(?:([^\/]+?)))\/details\/(?:([^\/]+?))$/i, keys:[{ "name": "id", "optional": false }, { "name": "sub", "optional":false }] } You can also define some routes as optional: var route = w2utils.parseRoute('/view/:id/details/:sub?') console.log(route); Returns route = { path: /^\/view(?:\/(?:([^\/]+?)))\/details(?:\/([^\/]+?))?$/i, keys:[{ "name": "id", "optional": false }, { "name": "sub", "optional":true }] } The "path" returned can be used as a regular expression to compare if path matches.
This method is used internally to process routes for w2toolbar, w2sidebar, w2tabs, etc.