<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def exclude_from_all(self, exclude_regex):
 """Exclude a pattern from proxy, spider and active scanner."""

        try:
            re.compile(exclude_regex)
        except re.error:
            raise ZAPError('Invalid regex "{0}" provided'.format(exclude_regex))

        self.logger.debug('Excluding {0} from proxy, spider and active scanner.'.format(exclude_regex))

        self.zap.core.exclude_from_proxy(exclude_regex)
        self.zap.spider.exclude_from_scan(exclude_regex)
        self.zap.ascan.exclude_from_scan(exclude_regex)