Thanks! That's much less complicated and does everything I wanted it to do. -- View this message in context: http://r.789695.n4.nabble.com/Search-and-extract-string-function-tp2290268p2290356.html Sent from the R help mailing list archive at Nabble.com.