private function _do_never_allowed_afterwards(string $str): string
    {
        if (\stripos($str, 'on') !== false) {
            foreach (self::$_never_allowed_on_events_afterwards as $event) {
                if (\stripos($str, $event) !== false) {
                    $regex = '(?<before>[^\p{L}]|^)(?:' . $event . ')(?<after>\s|[^\p{L}]|$)';

                    do {
                        $count = $temp_count = 0;

                        $str = (string) \preg_replace(
                            '#' . $regex . '#ius',
                            '$1' . $this->_replacement . '$2',
                            $str,
                            -1,
                            $temp_count
                        );
                        $count += $temp_count;
                    } while ($count);
                }
            }
        }

        return (string) \str_ireplace(
            self::$_never_allowed_str_afterwards,
            $this->_replacement,
            $str
        );
    }