I'm trying to do a lookbehind regex in R to find a pattern. I expect this would pull the 'b' in 'bob', but instead I get an error.
> regexpr("(?<=a)b","thingamabob")
Error in regexpr("(?<=a)b", "thingamabob") :
invalid regular expression '(?<=a)b', reason 'Invalid regexp'
This does not throw an error, but it also doesn't find anything.
> regexpr("(.<=a)b","thingamabob")
[1] -1
attr(,"match.length")
[1] -1
attr(,"useBytes")
[1] TRUE
I'm confused because the help page for regexpr specifically indicates that lookbehind should work: http://stat.ethz.ch/R-manual/R-patched/library/base/html/regex.html
Any ideas?