Re: [pcre-dev] PCRE feature request - "backwards" search

Góra strony
Delete this message
Autor: Philip Hazel
Data:  
Dla: Mark Taylor
CC: pcre-dev
Temat: Re: [pcre-dev] PCRE feature request - "backwards" search
On Sun, 19 Sep 2010, Mark Taylor wrote:

> forgive if I am being slow here... but if I add .* at the start of the
> RE, won't that make it match everything from the start of the subject
> string?


Yes, of course you are right; I am being slow. I didn't tell you the
whole story when I looked at the code in my editor, because I wasn't
paying enough attention. Sigh. More haste...

What it *actually* does is to convert <regex> into .*(<regex>) (note the
parentheses) and then use what matches the parentheses as its "match".

Philip

--
Philip Hazel