import re


def compile_routes(dynamic_routes):
    """Compiles the regexes in the routes table."""
    routes2 = []
    for (verb, path_pattern, handler_func) in dynamic_routes:
        compiled_path = re.compile("^" + path_pattern + "/*" + "$")
        entry = (verb, path_pattern, compiled_path, handler_func)
        routes2.append(entry)
        continue
    return routes2