Replace route match regex with custom logic