regex is powerful but I try to use it as little as possible
library(tidyverse)
library(lubridate)
df <- tibble(rawstring = "Message from authorname » Thu 6 May 2010, 21:21") %>%
rowwise() %>%
mutate(
twohalves = str_split(rawstring, "»"),
authorname = str_remove(
string = head(twohalves, 1),
pattern = "Message from "
),
datetext = head(unlist(str_split(
string = tail(twohalves, 1),
pattern = ","
)), 1),
date = lubridate::dmy(datetext)
)