Question: I have a vector of strings each containing last and first name of one or more authors. I would like to extract the last names of each author in each string. What I know is that the name that comes first is always the last name of an author (the first author), and the last names of the other authors are everything that is between between a `;` and a `,`. For example, in the following string:

```
tutu <- "goulenok, tiphaine miquel; meune, christophe; gossec, laure; dougados, maxime; kahan, andre; allanore, yannick"

```

I would like to extract:

```
"goulenok" "meune" "gossec" "dougados" "kahan" "allanore"

```

The last name may include punctuation characters such as `'` or `-` but always be between a `;` and a `,`

Any idea?

Answer: 
```
> sub(",.*$", "", strsplit(tutu, ";[ ]+")[[1]])
[1] "goulenok" "meune"    "gossec"   "dougados" "kahan"    "allanore"

```
This is a bit more blunt but also works:

```
sapply(unlist(lapply(strsplit(tutu, ";"), strsplit, ",")), "[", 1)

```