
Get the bookmark file identifier
get_bookmark_id.Rd
Given a character vector and the regular expression for the bookmark file identifier, return the extracted file identifier itself.
Arguments
- x
The character vector.
- filename
The file from which the character vector came - used as identifier (sanitized from invalid characters) id no identifier was specified.
- bm_id_regex
The bookmark identifier regular expression.
Examples
bookmark::get_bookmark_id(
c("First line",
"<!--[BOOKMARK::ID::testfile_1]-->",
"Second line",
"Third line"),
filename = "filename.txt"
);
#> [1] "filename"