NancyFx/Nancy — pull request #1054 by phillip-haydon (2013-03-30 11:02:56+00:00)
Title: Allow RegEx to specify end of line

Added a check in the factory to look for `)` and `)$` so that if a regex specifies an entire string match it still picks up the node.

This fixes an issue where if you have two routes like:

`@"^(?:(?videos/\d{1,10})(?:/{0,1}(?.*)))$"`

And

`@"^(?:(videos)(?:/page/?(?\d*))?)$"`

Where both seem to match and return true.

In the first case it was trying to add the 0 index match from both causing a key already exists exception. The real issue is two routes matched and added 0 index match.

Fixing the 0 index didn't fix the issue since it sometimes picks the wrong route of the two matches.

Specifying the RegEx to match the entire string filters out the invalid match and picks the right one.