Regex flags, dotall and multiline

Useful for work with multiline strings (i.e. strings that contain \n)

dotall = TRUE lets . match everything, including \n:

x <- "Line 1\nLine 2\nLine 3"
str_view(x, ".Line")
str_view(x, regex(".Line", dotall = TRUE))
## [1] │ Line 1<
##     │ Line> 2<
##     │ Line> 3

multiline = TRUE makes ^ and $ match the start and end of each line rather than the start and end of the complete string:

x <- "Line 1\nLine 2\nLine 3"
str_view(x, "^Line")
## [1] │ <Line> 1
##     │ Line 2
##     │ Line 3
str_view(x, regex("^Line", multiline = TRUE))
## [1] │ <Line> 1
##     │ <Line> 2
##     │ <Line> 3