Test, validate and match regular expressions
This regex matches author first names following a comma and optional whitespace, capturing up to three capitalized name segments (each starting with a capital letter, allowing abbreviations with periods, hyphens, or spaces). It stops before ' and' or the end of a line, enabling conversion of full forenames to initials in citation lists or bibliographies. Useful for name normalization and reference formatting.