Why is it that in R when using a single square brackets here returns FALSE, whereas using double square brackets returns TRUE? Example:
> grepl('[:alpha:]', 'AA')
[1] FALSE
> grepl('[[:alpha:]]', 'AA')
[1] TRUE
Why is it that in R when using a single square brackets here returns FALSE, whereas using double square brackets returns TRUE? Example:
> grepl('[:alpha:]', 'AA')
[1] FALSE
> grepl('[[:alpha:]]', 'AA')
[1] TRUE
[[:alpha:]] is a specific character class unique to regex in R. Check out character classes here
https://www.rstudio.com/wp-content/uploads/2016/09/RegExCheatsheet.pdf