Skip to content
Prev 43406 / 398506 Next

Variable substitution in grep pattern

On Thu, 29 Jan 2004, Alberto Fornasier wrote:
You can't do that.  If you could , how would you search for all strings
containing the letter "i"?

You need to use something like paste() to construct the pattern

length(grep(paste(".*",i,".*",sep=""),as.character(Licenza)))}

	-thomas