> When I started with jquery I advocated for this (powerful and easy to
> implement). I still think it's a good idea, but the answer at the time (last
> August, not so far back...) was that it could be plugged-in *very* easily:
> 
> http://jquery.com/discuss/2006-August/009428/
> http://jquery.com/discuss/2006-August/009429/

I have now tested this plugin a bit extensively, and it works well.

Plugin:
        jQuery.parse[0] = [ "\\[ *(@)S *([\\/!*$^=]*) *Q\\]", 1 ];
        jQuery.expr['@']['/='] = "new RegExp(m[4]).test(z)";

Usage:
        $(document).ready(function(){
          $("[EMAIL 
PROTECTED]/='^.*.toto.(gif|jpg)(\\?.*|$)']").css('color','red');
        });

However it breaks on the [ and ] chars.

So we can't write
        $("[EMAIL PROTECTED]/='^[a-z]+\\.txt']")

Also, the need for double-backslash is not perfect (but I guess this is out
of jQuery's scope, as we're using quotes-inside-quotes here).

-- Fil


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to