An interesting case, or, more appropriately, seven cases.
I believe using regular expressions would impact the very text readability you are looking to improve. A more user-centric approach would be to put the burden on the programmer, i.e. automatically resolve declined reference links. Leo Tolstoy from your example poses a challenge due to the exceptional declension of the first name (Лев -> Льва etc.). The last name, however, is conventional:
- Толстой
- Толстого
…
Therefore, it should be fairly straightforward to implement an extension that would accept the following:
... [Толстому] ...
[Толстой]: https://en.wikipedia.org/wiki/Leo_Tolstoy
In cases where additional content is required in the link text nested brackets could be used:
[Львом [Толстым]]
That would also enable
о [Л. [Толстом]]
and even
[[Толстой]]
This is in line with the wiki syntax, but could prove counterproductive if applied to an actual wiki scenario. In the latter case, the above label could first be checked against the document’s reference map, and if not found there, resolve to the respective wiki page. Ambiguity between references and wiki links would be resolved by using the full forms, i.e.
[Толстой](Толстой)
for direct links and
[Толстой][Толстой]
for reference links, or the collapsed form, i.e.
[Толстой]
for the latter.
The proposed syntax would obviously prove useless where e.g. both Leo Tolstoy and Alexei Tolstoy need to be referenced in the same document. In fact, it would fail for the latter’s granddaughter:
[Татьяны [Толстой]]
Such scenarios, however, are seemingly rare.
The declension of Лев would still require a solution for e.g. references to Leo the zodiac sign.
Why seven cases rather than six, you might ask. In this regard Russian is very similar to Latin, which also includes the vocative (звательный) case. Although the use of vocative in modern Russian is mostly confined to quoting classics, it should still be taken into account. Consider:
[Врачу], исцелися сам!
[врач]: www.imdb.com/title/tt0412142/
Although the above form is identical to that of the dative, the same does not hold for боже, человече, or (the more challenging) старче.
The latter example also illustrates a case normalization of a different kind, i.e. lower vs. upper case, which is already part of CommonMark.
The expression in the last example is a (commonly used) verbatim translation of the Latin Medice, cura te ipsum! The proposed extension would therefore benefit not only authors writing in Russian, but (with appropriate customizations) the sizable Latin-speaking community.