Extracts the value of a specified field from a BibTeX entry string using regular expressions. The function is case-insensitive and handles various spacing patterns around the field delimiter.
extract_field(entry, field)Character string containing the field value if found, NA if the field is not present
Character string containing a BibTeX entry
Name of the field to extract (e.g., "title", "author", "year")
The function searches for patterns of the form "field = {value}" in the BibTeX entry, ignoring case and allowing for variable whitespace around the equals sign. The value is expected to be enclosed in curly braces.