# single-line regular expression
x <- "(?xi) \\b \\w* willing \\w* \\b"
cat_re(x)
y <- "(?xi)
\\b # word boundary
\\w* # optional prefix
willing # stem
\\w* # optional suffix
\\b # word boundary"
cat_re(y)
cat_re(y, as_single_line = FALSE)
cat_re(y, format = "R")
cat_re(y, format = "R", as_single_line = FALSE)
regex <- re("(?xi)
\\b # word boundary
\\w* # optional prefix
willing # stem
\\w* # optional suffix
\\b # word boundary")
cat_re(regex)
cat_re(regex, as_single_line = FALSE)
Run the code above in your browser using DataLab