Escape regex wildcards during matching of routes

Dots in routes were wildcards when turned into regexes, thus sometimes causing problems when matching.

This fixes #2935.