You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my end, it looked like this. The intention was to show that there would be no match in this case. Instead, I get an error:
str_view_all("Misery, Misery, Misery that’s what Lord and Miller have chosen", "(Misery, ){,3}")
Error in stri_locate_all_regex(string, pattern, omit_no_match = TRUE, : Error in {min,max} interval. (U_REGEX_BAD_INTERVAL)
One of the answerers on Reddit explains:
"stringr uses ICU regular expressions, which apparently do not have the {,m} notation - use the explicit {n,m}."
Since the {,m} "method" is presented as a viable option in the latest version of the book and I did not see an open issue related to this, I thought I'd mention it here.
Perhaps the error message when using {,m} is clear enough and the inclusion of {,m} in the book is intentional (in the sense that it discusses a valid regex, albeit one that does not work with stingr, and is judiciously not included in the examples of stingr applications)?
The text was updated successfully, but these errors were encountered:
…ypos in "Iteration chapter" (#808)
* Update and rename strings.Rmd to strings.Rmd
Proposed fix related to this issue: #807
A more comprehensive fix should perhaps discuss why "`{,m}`: at most m" does not work (or warn the reader that it does not)
* Typos in iteration.Rmd
Correcting two small typos
* Add missing word
* Add code example for 1,m
Co-authored-by: Mine Cetinkaya-Rundel <cetinkaya.mine@gmail.com>
r4ds/strings.Rmd
Line 363 in ce824d0
As I was writing lecture notes based on the "strings" chapter, I stumbled upon the exact same issue as described in this Reddit thread: https://www.reddit.com/r/rprogramming/comments/8oyy1a/stringr_str_view_repetition_at_most_n_times/
On my end, it looked like this. The intention was to show that there would be no match in this case. Instead, I get an error:
str_view_all("Misery, Misery, Misery that’s what Lord and Miller have chosen", "(Misery, ){,3}")
Error in stri_locate_all_regex(string, pattern, omit_no_match = TRUE, : Error in {min,max} interval. (U_REGEX_BAD_INTERVAL)
One of the answerers on Reddit explains:
Since the
{,m}
"method" is presented as a viable option in the latest version of the book and I did not see an open issue related to this, I thought I'd mention it here.Perhaps the error message when using
{,m}
is clear enough and the inclusion of{,m}
in the book is intentional (in the sense that it discusses a valid regex, albeit one that does not work withstingr
, and is judiciously not included in the examples ofstingr
applications)?The text was updated successfully, but these errors were encountered: