POSIX character class does not work in base R regex
问题 I'm having some problems matching a pattern with a string of text in R . I'm trying to get TRUE with grepl when the text is something like "lettersornumbersorspaces y lettersornumbersorspaces". I'm using the following regex : ([:alnum:]|[:blank:])+[:blank:][yY][:blank:]([:alnum:]|[:blank:])+ When using the regex as follows to obtain the "address" it works at expected. regex <- "([:alnum:]|[:blank:])+[:blank:][yY][:blank:]([:alnum:]|[:blank:])+" address <- str_extract(fulltext, regex) I see