-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
from https://tdhock.github.io/blog/2026/links-to-bibtex/
link_pattern <- list(
"\\[",
title=".*?",
"\\]\\(",
url="http.*?",
"\\)")
before_pattern <- list(
before="(?s).*?",
nc::alternatives(
link=link_pattern,
"$"))more generic
before <- function(...)list(
before="(?s).*?",
nc::alternatives(
pattern=list(...),
"$"))
nc::capture_all_str(
"before [foo](http) between [bar text](http) after",
before(
"\\[",
title=".*?",
"\\]\\(",
url="http.*?",
"\\)"))output
> nc::capture_all_str(
+ "before [foo](http) between [bar text](http) after",
+ before(
+ "\\[",
+ title=".*?",
+ "\\]\\(",
+ url="http.*?",
+ "\\)"))
before pattern title url
<char> <char> <char> <char>
1: before [foo](http) foo http
2: between [bar text](http) bar text http
3: after Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels