search for: _greedy_

Displaying 2 results from an estimated 2 matches for "_greedy_".

2017 Apr 05
0
Bug report: POSIX regular expression doesn't match for somewhat higher values of upper bound
...ern <- paste0('(.{1,',n,'})\\1', collapse="") ## can have empty n ans <- grep(pattern, txt, value=TRUE, ...) cat(sprintf("pattern '%s' : ", pattern)); print(ans, quote=FALSE) invisible(ans) } grep1r({}, tx)# '.{1,}' : because of _greedy_ matching there is __no__ repetiion! grep1r(100,tx)# i.e., these both give an empty match : character(0) ## matching at most once: grep1r(1, tx)# matches all 5 starting with "foo" grep1r(2, tx)# ditto : all have more than 2 chars grep1r(3, tx)# not "foo": those with more tha...
2017 Apr 04
2
Bug report: POSIX regular expression doesn't match for somewhat higher values of upper bound
Dear Sirs, while > regexpr('(.{1,2})\\1', 'foo') [1] 2 attr(,"match.length") [1] 2 attr(,"useBytes") [1] TRUE yields the correct match, an incremented upper bound in > regexpr('(.{1,3})\\1', 'foo') [1] -1 attr(,"match.length") [1] -1 attr(,"useBytes") [1] TRUE incorrectly yields no match. R versions tested: 2.11.1