r - Find pattern containing string not preceeded by other string -
i use grepl
function in r find if string contains something, on condition not preceeded else.
so example wanted find string includes pattern 'xx'
, long not preceeded 'yy'
. so:
'123xx45'
world return true
'123yy4xx5'
return true
'yy'
not preceding 'xx'
however '123yyxx45'
return false
.
please let me know if unclear or better example.
how grepl('(?<!yy)xx', c('123yy4xx5','123xx45','123yyxx45'), perl=true)
?
Comments
Post a Comment