Here's what I came up with: > gsub("(\\w)[^ ]+[\\b ]", "\\1", astr) [1] "Timtowtdit"
You might be interested in Regular Expressions Cookbook from O'Reilly (publisher not author) or http://www.regular-expressions.info/ I usually bumble along knowing there are better ways to do whatever I am doing. Michael ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.