regex - Replace text between two special characters -
i have character vector as:
x<- "\t\t<taxon id=\"tot_f50\"/>"
and
y<- "tot_a01"
and want replace tot_f50
text in y ("tot_a01").
do know how replace text between " , \ (i.e. "tot_f50) ?
try
sub('(?<=").*(?=")', y, x, perl=true) #[1] "\t\t<taxon id=\"tot_a01\"/>"
Comments
Post a Comment