import re


def http_header_link_regex(relation_type):
    """Create a regex matching the http header links of the given type."""
    return re.compile(r'.*;+\s*rel="{}"\s*(;.*)?'.format(
        re.escape(relation_type)))