I would like to find the position of the following pattern: lower case letter followed by any character followed by any digit in the following string:
my_string <- "The current year is 2016"
my_pattern <- "[:lower:].[:digit:]"
library(stringr)
str_locate(my_string, my_pattern)
regexpr(my_pattern, my_string)
However get different results with str_locate (start 19) and regexpr (start 9)? Can anyone explain me why this happens?
R version 3.4.0 (2017-04-21) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS 10.13.1 stringr_1.2.0