Francesco Del Vecchio wrote:
> Sorry...I tryied to keep my mail short:
>
> I have to match /img/giallo.gif
>
> HERE -> "/img/giallo.gif"
> HERE -> "whaterveryouwant/img/giallo.gif"
> HERE -> "/img/giallo.gif?mypar"
> NOT HERE -> "http://www.html.it/img/giallo";
>
> I hope this clarify you.

Thank you. Yes, I see now. The following uses a (negative)
look-behind assertion construct (?<! .. ), and matches
'/img/giallo.gif' unless preceded by 'http://www.html.it'.

    foreach (qw(
            /img/giallo.gif
            whaterveryouwant/img/giallo.gif
            /img/giallo.gif?mypar
            http://www.html.it/img/giallo)) {

        print "NOT " unless m{(?<! \Qhttp://www.html.it\E )
\Q/img/giallo.gif\E }ix;
        print 'HERE -> "', $_, "\"\n";
    }

output

    HERE -> "/img/giallo.gif"
    HERE -> "whaterveryouwant/img/giallo.gif"
    HERE -> "/img/giallo.gif?mypar"
    NOT HERE -> "http://www.html.it/img/giallo";

HTH,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to