Lexer->addSpecialPattern('<' . PREG_PATTERN_VALID_EMAIL . '>', $mode, 'emaillink'); } /** @inheritdoc */ public function handle($match, $state, $pos, Handler $handler) { $email = preg_replace(['/^$/'], '', $match); $handler->addCall('emaillink', [$email, null], $pos); return true; } }