<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _extract_domain_id(string, regex):
 """ Extracts domain ID from given string and returns the domain ID. """

        regex = re.compile(regex)
        match = regex.search(string)
        if not match:
            return False
        return str(match.group(1))