[Rd] Bug report: POSIX regular expression doesn't match for somewhat higher values of upper bound

dietmar.schindler at manroland-web.com dietmar.schindler at manroland-web.com
Tue Apr 11 08:16:45 CEST 2017


> Von: Martin Maechler [mailto:maechler at stat.math.ethz.ch]
> Gesendet: Mittwoch, 5. April 2017 11:15
>
> >>>>>   <dietmar.schindler at manroland-web.com>
> >>>>>     on Tue, 4 Apr 2017 08:45:30 +0000 writes:
>
>     > 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.
>
> Hmm, yes, I would also say that this is incorrect
> (though I'm always cautious: The  ?regex  help page explicitly
>  mentions greedy repetitions, and these can "bite you" ..)
>
> The behavior is also different from the  perl=TRUE one which is
> correct (according to the above understanding).
>
> ...

Shouldn't this be submitted on R's Bugzilla then (which I as a non-member can't)?
--
Best regards,
Dietmar Schindler
________________________________
manroland web systems GmbH -- Managing Director: Alexander Wassermann
Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No.: 26816 -- VAT: DE281389840

Confidentiality note:
This eMail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this eMail in error, then please delete this eMail.



More information about the R-devel mailing list