Re: [pcre-dev] PCRE and recursion feature - (?R) - doesn't w…

Page principale
Supprimer ce message
Auteur: Matthias B.
Date:  
À: pcre-dev
Sujet: Re: [pcre-dev] PCRE and recursion feature - (?R) - doesn't work as expected
Philip Hazel wrote:
> A usable recursive regex, like a recursive function in a programming
> language, must have some way of stopping the recursion. Your pattern
> goes on for ever. It matches an infinite number of \w (which is of
> course impossible). A slightly different pattern:
>
> \w($|(?R))
>
> is the same as
>
> \w+
>
> Notice the option for stopping when the end of the text is reached.
>

Thank you very much Philip, that cleared it up for me - I might have
guessed that.

Best regards,
Matthias