def list2regex(sclist):
    """
    Called by loanpy.adrc.Adrc.reconstruct. \
Turns a list of phonemes into a regular expression.

    :param sclist: a list of phonemes
    :type sclist: list of str

    :returns: The phonemes from the input list separated by a pipe. "-" is \
removed and replaced with a question mark at the end.
    :rtype: str

    :Example:

    >>> from loanpy.helpers import list2regex
    >>> list2regex(["b", "k", "v"])
    '(b|k|v)'

    >>> from loanpy.helpers import list2regex
    >>> list2regex(["b", "k", "-", "v"])
    '(b|k|v)?'

    """

    if sclist == ["-"]:
        return ""
    if "-" in sclist:
        return "("+"|".join([i for i in sclist if i != "-"]) + ")?"
    return "("+"|".join(sclist) + ")"