Re: [R] Extracting everything between two symbols in a string

2014-02-16 Thread Rui Barradas
Hello, Try the following. x <- "Braund, Mr. Owen Harris" sub("^.*, (M[[:alpha:]]*)\\..*$", "\\1", x) Hope this helps, Rui Barradas Em 16-02-2014 12:50, Gianluca Rossi escreveu: Hello, I have a vector containing some names. I want to extract the title on every row, basically everything betw

[R] Extracting everything between two symbols in a string

2014-02-16 Thread Gianluca Rossi
Hello, I have a vector containing some names. I want to extract the title on every row, basically everything between the ", " (included the white space) and "." > head(combi$Name) [1] "Braund, Mr. Owen Harris" [2] "Cumings, Mrs. John Bradley (Florence Briggs Thayer)" [3] "Heik