Module:Sandbox/Erutuon/author citation: Difference between revisions

Content deleted Content added
attempt to translate regex for botanist author citation (d:Property:P428#P1793) to Lua
 
add start and end parameters
Line 12:
-- [[d:Property:P428#P1793]]
-- ('t )?(d')?(de )?(la )?(van (der )?)?(Ma?c)?(De)?(Di)?\p{Lu}?C?['\p{Ll}]*([-'. ]*(van )?(y )?(d[ae][nr]?[- ])?(Ma?c)?[\p{Lu}bht]?C?['\p{Ll}]*)*\.? ?f?\.?
function p.is_author_citation(str, i, j)
local pos = i or 1
for _, prefix in ipairs {
"'t ", "d'", "de ", "la ", "van der ", "van ", "Ma?c", "De", "Di", "%l?C?['%l]*",
Line 34:
pos = advance_pos_if_starts_with(str, "%.? ?f?%.?")
return pos == (j or #str)
end