Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stri_detect_regex gives non-intuitive error (U_ILLEGAL_ARGUMENT_ERROR) with strings longer than 858993457 characters #487

Closed
calpan opened this issue Jan 3, 2023 · 1 comment

Comments

@calpan
Copy link

calpan commented Jan 3, 2023

> s = sample(letters, 859000000, replace = T) |> paste0(collapse='')
> stringi::stri_detect_regex(substr(s, 1, 858993457), 'Warning')
[1] FALSE
> stringi::stri_detect_regex(substr(s, 1, 858993458), 'Warning')
Error in stringi::stri_detect_regex(substr(s, 1, 858993458), "Warning") : 
  Illegal argument. (U_ILLEGAL_ARGUMENT_ERROR)
@gagolews
Copy link
Owner

gagolews commented Nov 7, 2023

This is actually a bug in a few functions. Fix on the way.

stri_detect_regex(stri_dup("x", 858993458), "x")
## [1] TRUE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants