test <- 'abcdef abc<span abc>defabc abcdef</span> abc defabc'gsub('\\babc(?![^<]*>)', 'xxx', test, perl=TRUE)
Standard input is empty
[1] "xxxdef xxx<span abc>defabc xxxdef</span> xxx defabc"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!