Updated route matching to not let strings run away.

Previously a string was not tested against the full line so was allowed to have any charaters at the end of a matching string.

Fixes T58