Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions R/parse_bibtex.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ parse_bibtex <- function(x){
# use `unglue` to parse text
# 1. Matching reference to the type of reference (e.g. article)
# 2. Matches each of the variables to their corresponding values
# - Allows zero or more spaces around the equals sign `=`
# - Removes any white space out the front of the variable name
# - Allows zero or more spaces around the equals sign
# - Comma at the end is optional
raw_df <- unglue_data(x,
patterns = c("@[variable]{[value],",
"[variable][=\\s*=\\s*]{[value]}[=,?]"),
"[=\\s*][variable][=\\s*=\\s*]{[value]}[=,?]"),
open = "[",
close = "]")

Expand Down