import re


def active_page(url, regex):
    """Check the current url with regex and return 'active' if matched.

    Avoid using this filter: better is to make use of CSS inheritance.
    """
    if re.search(regex, url):
        return 'active'
    else:
        return ''