Re: [Rd] Question about regexp edge case

2024-08-01 Thread Duncan Murdoch
Thanks Tomas. Do note that my original post also mentioned a bug or doc error in the PCRE docs for this regexp: - perl = TRUE does *not* give the documented result on at least one system (which is "123456789", because "{,5}" is documented to not be a quantifier, so it should only match the

Re: [Rd] Question about regexp edge case

2024-08-01 Thread Tomas Kalibera
On 7/29/24 09:37, Ivan Krylov via R-devel wrote: В Sun, 28 Jul 2024 20:02:21 -0400 Duncan Murdoch пишет: gsub("^([0-9]{,5}).*","\\1","123456789") [1] "123456" This is in TRE itself: for "^([0-9]{,1})" tre_regexecb returns {.rm_so = 0, .rm_eo = 1}, matching "1", but for "^([0-9]{,2})" and ab