Automatically link Magic: The Gathering cards

$configurator = new s9e\TextFormatter\Configurator;

// Get a list of every card name you want to automatically link
$cards = [
    'Abomination', 'Act of Aggression', 'Armageddon', // etc...
    'Zuran Orb', 'Zuran Spellcaster'

foreach ($cards as $card)
    // Add the card name as a keyword

    // BONUS: keywords are case-sensitive but we can add variants of the same
    //        names. Here, we capitalize lowercase words
    if ($card !== ucwords($card))

// Define how the names are rendered. Here, as a link to Gatherer
    = '<a href="[m/^{@value}$/]"><xsl:apply-templates/></a>';

// Get an instance of the parser and the renderer

$text = 'Armageddon and Zuran Orb';
$xml  = $parser->parse($text);
$html = $renderer->render($xml);

echo $html;
<a href="$/%5D">Armageddon</a> and <a href="$/%5D">Zuran Orb</a>