{"action":"created","issue":{"url":"https://api.github.com/repos/pillarjs/path-to-regexp/issues/76","repository_url":"https://api.github.com/repos/pillarjs/path-to-regexp","labels_url":"https://api.github.com/repos/pillarjs/path-to-regexp/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/pillarjs/path-to-regexp/issues/76/comments","events_url":"https://api.github.com/repos/pillarjs/path-to-regexp/issues/76/events","html_url":"https://github.com/pillarjs/path-to-regexp/issues/76","id":154390083,"number":76,"title":"help: Handling parentheses in the path pattern not related prefixes","user":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-12T03:37:29Z","updated_at":"2016-05-13T16:07:36Z","closed_at":null,"body":"I currently use `path-to-regexp` in Sway and a user reported [an issue](https://github.com/apigee-127/sway/issues/79) that I believe will require me to do a little escaping prior to calling `path-to-regexp`.  The user is currently trying to create an OData path like `/Users(:id)` but a request path of `/Users(1)` does not match the regex where I would expect it to.  Now, I realize the reason for this is that parentheses are special but before I just go blindly escaping/hacking this to work, I wanted to get your opinion on how best to handle this situation.\r\n\r\n**Note:** OpenAPI/Swagger use bracket-based variable naming in paths so in the linked issue you'll see `/Users({id})` instead of `/Users(:id)`.  Do not let this trip you up because I already handle converting OpenAPI/Swagger paths to Express-style paths.  Also, OpenAPI/Swagger paths do not allow regex in their path pattern _(in case that matters with suggesting a solution)_."},"comment":{"url":"https://api.github.com/repos/pillarjs/path-to-regexp/issues/comments/219087770","html_url":"https://github.com/pillarjs/path-to-regexp/issues/76#issuecomment-219087770","issue_url":"https://api.github.com/repos/pillarjs/path-to-regexp/issues/76","id":219087770,"user":{"login":"blakeembrey","id":1088987,"avatar_url":"https://avatars.githubusercontent.com/u/1088987?v=3","gravatar_id":"","url":"https://api.github.com/users/blakeembrey","html_url":"https://github.com/blakeembrey","followers_url":"https://api.github.com/users/blakeembrey/followers","following_url":"https://api.github.com/users/blakeembrey/following{/other_user}","gists_url":"https://api.github.com/users/blakeembrey/gists{/gist_id}","starred_url":"https://api.github.com/users/blakeembrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakeembrey/subscriptions","organizations_url":"https://api.github.com/users/blakeembrey/orgs","repos_url":"https://api.github.com/users/blakeembrey/repos","events_url":"https://api.github.com/users/blakeembrey/events{/privacy}","received_events_url":"https://api.github.com/users/blakeembrey/received_events","type":"User","site_admin":false},"created_at":"2016-05-13T16:07:36Z","updated_at":"2016-05-13T16:07:36Z","body":"@whitlockjc Most of the work come from Osprey (https://github.com/mulesoft/osprey) which mostly involved a bit of refactoring of the router (https://github.com/pillarjs/router/pull/29) to support custom path handlers, at which point I wrote https://github.com/mulesoft-labs/raml-path-match. I've been meaning to correct that router and release it separately so more people can actually use it, but the PR's been around for almost a year and a half now \r\n\r\n/cc @dougwilson "}}