fork(2) download
  1. y <- c("1. Stąck is great and awesome", "2. Stack")
  2. regmatches(y, regexpr("\\p{L}+(?:\\s+\\p{L}+){0,2}", y, perl=TRUE))
  3. regmatches(y, regexpr("[[:alpha:]]+(?:[[:space:]]+[[:alpha:]]+){0,2}", y))
Success #stdin #stdout 0.23s 39748KB
stdin
Standard input is empty
stdout
[1] "Stąck is great" "Stack"         
[1] "Stąck is great" "Stack"