Re: [pcre-dev] Ungreedy quantification in atomic groups

Startseite
Nachricht löschen
Autor: Sheri
Datum:  
To: pcre-dev
Betreff: Re: [pcre-dev] Ungreedy quantification in atomic groups
Philip Hazel wrote:
> (?>\\|\t|\Q.+?\E|\$(?:U|u|L|l|T|t)?\d{1,3})
>
> but that still doesn't make too much sense because \Q.+?\E matches the
> literal string ".+?". So where is the ungreedy qualifier?
>
> Philip
>
>

With the doubled backslashes, that alternate matches backslash Q and
everything inclusive up thru the next backslash E. These alternates are
tokens in a string where each token is an atom as far as I'm concerned
(is why I used the atomic group), but since discussion of atomic group
speaks only of greedy quantifiers, I wasn't certain this application was
desirable. As far as matching, it is matching what I want to match (next
atom in the string, from wherever startoffset is). Will attempt some
timing tests with pcretest.

Thanks,
Sheri