Szerző: ND Dátum: Címzett: Pcre-dev Tárgy: Re: [pcre-dev] Some words about assertion docs
On 2019-06-22 15:20, ph10 wrote: > On Sat, 22 Jun 2019, ND via Pcre-dev wrote:
>> Your example is not working right (let's change 10 to 3 for
> simplicity):
> >> /\A.*\b(\w++)(?>.*?\b\1\b){2}/
> > word1 word1 word2 word2 word2 word1
> > 0: word1 word1 word2 word2 word2
> > 1: word2
> >> We want to capture "word1" as most closer to the end of text. But
> "word2"
> > captures.
>I did not understand what you wanted. My regex finds the word whosethree
> appearances are closest to the end of the text, which is what Ithought
> you were looking for.
>
Sorry for my bad English.
I need to find word that is closest to the end of text and occurs at least
10 times in that text.