## Base R PCRE pattern
x <- "abcde\n		fghij<FooBar>"
regmatches(x, regexec("(?s)(.*)<FooBar>",x, perl=TRUE))[[1]][2]