Skip to content

Matched route returns wrong value for capture group #28

@deyhle

Description

@deyhle

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions