def named_capturing(pattern, name):
    """ generate a named capturing pattern

    :param pattern: an `re` pattern
    :type pattern: str
    :param name: a name for the capture
    :type name: str

    :rtype: str
    """
    return r'(?P<{:s}>{:s})'.format(name, pattern)