>>>>> Bill Dunlap on Fri, 5 May 2023 08:19:21 -0700 writes: https://bugs.r-project.org/show_bug.cgi?id=16745 (from 2016, still labelled 'UNCONFIRMED") contains some other examples of strsplit misbehaving when using 0-length perl look-behinds. E.g.,
Thank you, Bill -- yes, uhmm, ... a bit embarrassing. I've finally changed the R bugzilla report's state to "CONFIRMED" now, and also added the "HELPWANTED" keyword. I think we (R Core) should be sorry to have (forgotten / not cared about) the issue completely. It's not hard to at least agree that the current behavior is buggy, e.g., in the example you show here : >> strsplit(split="[[:<:]]", "One, two; three!", perl=TRUE)[[1]] > [1] "O" "n" "e" ", " "t" "w" "o" "; " "t" "h" "r" "e" "e" "!" >> gsub(pattern="[[:<:]]", "#", "One, two; three!", perl=TRUE) > [1] "#One, #two; #three!" [...] [...] Maybe this should be continued either on Bugzilla (i.e., the URL above), or if needed, additionally on R-devel. Yes, I also added that we'd grateful for (tested) patches and/or code reviewers. Martin -- Martin Maechler ETH Zurich and R Core team ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.