in reply to Extracting Bibliography Citations

You asked if one could leverage the templates from Biblio-Citation-Parser to define a grammar.

Biblio::Citation::Parser::Standard matches the entire input against the each template, and picks the most "reliable" and "concrete" of the matches. (The templates are weighted.) I don't know what effect it would have if you didn't require the entire input to be matched (i.e. changed $ref =~ /^$currtemplate$/ to $ref =~ /^$currtemplate/).

The problem is that longer is considered better.

use Biblio::Citation::Parser::Standard qw( ); BEGIN { *get_reliability = \&Biblio::Citation::Parser::Standard::get_r +eliability; } my $r1 = get_reliability('_AUTHORS_ (_YEAR_) _TITLE_. _PUBLICATION_'); my $r2 = get_reliability('_AUTHORS_ (_YEAR_) _TITLE_' ); print(($r1 > $r2 ? 'ok' : 'not ok'), " (r1: $r1, r2: $r2)\n");
ok (r1: 2.7, r2: 2.05)

So if the text matched by _PUBLICATION_ was suppose to be the start of the next citation, we got a problem.

Another likely problem is the use of _ANY_. Those that end with _ANY_ are a definite problem.