<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_builton(self, built_on, regex):
 """Extracts node name using a regular expression. Node name is expected to be group 1. """

        pattern = re.compile(regex, re.M | re.I)
        match = pattern.search(built_on)
        if match and len(match.groups()) >= 1:
            node_name = match.group(1)
        else:
            msg = "Node name not extracted, using builtOn as it is: " + regex + ":" + built_on
            logger.warning(msg)
            node_name = built_on

        return node_name