import re


def is_active(request, pattern):
    """Check url to decide if navigation is active.

    :request: http request of page
    :pattern: the pattern to check against
    :returns: the class of an active mdl element

    """
    pattern = "^%s$" % pattern
    if re.search(pattern, request.path):
        return 'is-active'
    return ''