I'm trying to search and replace citations from pandoc-markdown. They have the following syntax:
[prenote @autorkey, postnote]
Or for more than one Author
[prenote1 @authorekey1, postnote1; prenote2 @authorkey2, postnote2]
The pre-notes, the author-keys and the post-notes should each be in their own capture group.
For only one author in a citation I used regex this:
\[((.*) )?@(.*?)(, (.*))?\]
But I can't figure out how to match a citation with multiple authors. Ideally it would be possible to match citations with one or more author keys. The pre-note and the post-note should be optional.
Is this possible?