Hello, try this:
x <- c("SELECT [public_tblFiche].[Fichenr], [public_tblArtnr].[Artnr]", "SELECT public_tblFiche.Fichenr, public_tblArtnr.Artnr") # > The square backets [ and ] should removed x <- gsub("[][]", "", x) # > and xxx_xxx.xxx should become \"xxx\".\"xxx\"\".\"xxx\" x <- gsub("([[:alpha:]]+)_([[:alpha:]]+)\\.([[:alpha:]]+)", "\"\\1\".\"\\2\".\"\\3\"", x) -- Noia Raindrops noia.raindr...@gmail.com ______________________________________________ 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.