After updating R to version 3.2.0 (from "Spring Dance" 3.1.0), I am having an unforeseen regex error.
I had the following code to find characters that contain X, followed by four or more numerical digits.
library(stringr)
vec = c("X12345", "X12", "X235252", "X442")
str_detect(vec, "X[0-9]{4, }")
Obviously, empty space after a comma means four-or-more. However, in R 3.2.0, this above statement yields an error.
Error in stri_detect_regex(string, pattern, opts_regex = attr(pattern, :
Error in {min,max} interval. (U_REGEX_BAD_INTERVAL)
Error during wrapup:
This is in fact caused by empty space following the comma in regex. However, to my knowledge, above statement is totally fine, and worked just fine in the previous version.
Does anyone know if regex engine had changed, and perhaps offer me a workaround for this, other than putting huge number after the comma? (Proper regular expression that matches four or more digits)