import re


def extract_fasta_id(seqIdString):
    """
    Extract the id in the fasta description string, taking only the characters till the '|'.
    """
    seqId = None
    regex1 = re.compile(r'^\s*?([^|]+?)(\s|\||$)')
    seqIdSearch = re.search(regex1, seqIdString)
    if seqIdSearch:
        seqId = seqIdSearch.group(1)
    return seqId