extract_field: Extract field value from BibTeX entry

View source: R/citation.R

extract_fieldR Documentation

Extract field value from BibTeX entry

Description

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.

Usage

extract_field(entry, field)

Arguments

entry

Character string containing a BibTeX entry

field

Name of the field to extract (e.g., "title", "author", "year")

Details

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.

Value

Character string containing the field value if found, NA if the field is not present


matriz documentation built on April 3, 2025, 7:22 p.m.