import re


def parse_freq_err_resp(resp):
    """ Parse the frequency error response

    @param resp: response from ATECPS
    @return: frequency error in Hz
    """
    pattern = '\[(.+)\]'
    freqerr = re.search(pattern, resp)
    if freqerr:
        return int(freqerr.group(1))
    else:
        return 0