pattern = '\b(?i)file(?-i)://[' . $any . ']+?[' . $punc . ']*[^' . $any . ']'; } /** @inheritdoc */ public function connectTo($mode) { $this->Lexer->addSpecialPattern( $this->pattern, $mode, 'filelink' ); } /** @inheritdoc */ public function handle($match, $state, $pos, Handler $handler) { $handler->addCall('filelink', [$match, null], $pos); return true; } }