I struggle to find a solution for following regex problem. I want to match from the beginning of the string everything with G06 but exclude G06Q. I guess its some kind of lookbehind?
mystring <- c('G06', 'G06Q', 'G11C')
What I want is
[1] "G06"
As a starter I tried following but it need obviously some additional part
grep("^G06", mystring, value=TRUE, perl=TRUE)
gives me
[1] "G06" "G06Q"
Similar problem can be found here Link but I struggle to use it for my problem at hand.