[R] Question about PERL lookahead construct in regex's

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Wed Aug 12 16:41:43 CEST 2020


Thank you.
That indeed dispels my brain fog!

Best,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Wed, Aug 12, 2020 at 6:35 AM Stefan Evert <stefanML using collocations.de>
wrote:

>
> > On 10 Aug 2020, at 18:36, Bert Gunter <bgunter.4567 using gmail.com> wrote:
> >
> > But this appears to be imprecise (it confused me, anyway). The usual
> sense
> > of "matching" in regex's is "match the pattern somewhere in the string
> > going forward." But in the perl lookahead construct it apparently must
> > **exactly** match *everything* in the string that follows.
> >
> > Questions:
> > Am I correct about this? If not, what do I misunderstand?
>
> I think you're confused about the terminology.  To _match_ a regular
> expression is to find a substring described by the regexp at a given
> starting point; what you have in mind is to _search_ a string for matches
> of a regular expression.
>
> Python uses this terminology in its regexp matching functions, and from
> what you cited in the documentation so do Perl and PCRE in their docs.
>
> Best,
> Stefan
> ______________________________________________
> R-help using 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list