def set_regex_parentheses(parent_paragraph_id):
    """ Adds parentheses if the paragraph has a parent.
    Paragraphs with a parent ( = subparagraphs ) have
    their identifiers wrapped in parentheses and an em dash.
    """
    par_open = r""
    par_close = r""
    if parent_paragraph_id:
        par_open += r"—\("
        par_close += r"\)"

    return par_open, par_close