Skip to content
Prev 323878 / 398503 Next

how to GREP out a string like this......THANKS.

On May 20, 2013, at 4:45 PM, Hon Kit (Stephen) Wong wrote:

            
[1] "Egfl6"

You can use;

lapply( lines, function(l) strsplit(l, " // ")[[1]][2] )
Well, grep is only going to give you a test and you want a replacement or extraction function. sub or gsub would be possibilities but they are greedy so its a bit more difficult to constrain their targeting to only the first  and second "//".