- // to handle them later on a per-char level.
- iname = subst(iname, from_ascii(" and "), from_ascii(" & "));
+ // to handle them later on a per-char level. Note that arbitrary casing
+ // ("And", "AND", "aNd", ...) is allowed in bibtex (#10465).
+ static regex const and_reg("(.* )([aA][nN][dD])( .*)");
+ smatch sub;
+ string res = to_utf8(iname);
+ while (regex_match(res, sub, and_reg))
+ res = sub.str(1) + "&" + sub.str(3);
+ iname = from_utf8(res);