protected function compileTargetCharacter($char)
    {
        switch (true) {
            case $char === 'remove':
                return function ($matches) {
                    return '';
                };

            case $char === 'keep':
                return function ($matches) {
                    return $matches[0];
                };

            case preg_match('("(?:[^\\\\"]+|\\\\\\\\|\\\\\'|\\\\")*?")', $char):
                $string = str_replace(
                    array('\\\\', '\\"', "\\'"),
                    array('\\', '"', "'"),
                    substr($char, 1, -1)
                );

                return function ($matches) use ($string) {
                    return $string;
                };

            default:
                $char = $this->compileCharacter($char);

                return function ($matches) use ($char) {
                    return $char;
                };
        }
    }