Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matched route returns wrong value for capture group #28

Open
deyhle opened this issue Jan 11, 2013 · 0 comments
Open

Matched route returns wrong value for capture group #28

deyhle opened this issue Jan 11, 2013 · 0 comments

Comments

@deyhle
Copy link

deyhle commented Jan 11, 2013

I have a regex route containing the capture group (.+) (matching everything).
This works as expected most of the time and I can access the matched group in the third argument of bind´s callback function. However, numeric values are somehow modified. 01 becomes 1… alright. But: 053 becomes 43. And 0123 becomes 83.

My Code is:

router.get(/^search\/(.+)?$/).bind(function(req, res, val){
    console.log("req.url.path: "+req.url.path)
    console.log("captured: "+val);
});

And the output is:

req.url.path: /search/0123
captured: 83

It's not a Javascript issue, if I match the path using the regex.exec function, the capture group is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant