What regex does Parsoid use to catch and parse URLs? I asked at en:WP:VPT and was redirected here.
Topic on Talk:Parsoid
Appearance
Autourls and external links are parsed in this PEG grammar block. So, Parsoid doesn't just use a regex for it.
Parsoid doesn't use regexes for that, https://github.com/wikimedia/parsoid/blob/master/src/Wt2Html/Grammar.pegphp#L932-L983
It tries to match what the legacy parser does in Parser::makeFreeExternalLink
The part that seems to be confusing is this removing of the trailing punctuation bit, https://github.com/wikimedia/mediawiki/blob/master/includes/parser/Parser.php#L1897-L1902
Thank you both for answering. I guess I'll just have to learn PHP to figure out the rest.