According to the code in Application\Filter\Linkify, it was supposed to be possible to see both the current word ("1234") and the previous word ("Bug") to determine if the words matched the desired pattern. This is supposed to be accomplished by adding a 3rd arg ($last) to the callback function:
Linkify::addCallback( function ($value, $escaper, $last)
After a bit of digging, I determined that $last was always the same as $value. It turns out there's a bug in the delivered Linkify.php. To get this to work properly, you simply need to make a one word change on line 285 of /opt/perforce/swarm/module/Application/src/Application/Filter/Linkify.php from:
$replace = $callback['callback']($trimmed, $escaper, $last, $baseUrl);to:
$replace = $callback['callback']($trimmed, $escaper, $lastWord, $baseUrl);
i.e. replacing $last with $lastWord. After making this change, I can now successfully pattern match on the current word ($value) and the previous word ($last).