I have a special question about regular expressions in R:
grepl("(|^)over","stackoverflow") # [1] TRUE grepl("(^|)over","stackoverflow") # [1] FALSE grepl("(^|x|)over","stackoverflow") # [1] FALSE grepl("(x|^|)over","stackoverflow") # [1] FALSE grepl("(x||^)over","stackoverflow") # [1] TRUE
Why aren't all of these expressions evaluated before TRUE ?
regex r
Daniel Gerigk
source share