Hi folks,
I am looking how to filter a full <div> bloc when its header does not contain an id="xxxx" but contains a specific class.
in example :
<div id="tralala" class="Class1 Class2"> .....</div> must not be filtered, while
<div class="Class1 Class2"> ...</div> must be.
I tested so many syntaxes that I am completely out of mind !
Does anyone can tell me if making a such filter is even possible ?
and how ....
Thank you very much for any help.
Amy
Mixing regular expression and DIV
Re: Mixing regular expression and DIV
This should do the trick:
Code: Select all
example.com##div.Class1.Class2:not(#tralala)
Re: Mixing regular expression and DIV
Indeed ! Is there a place where these tricks are detaillled ? I searched through all the docs pages without find them.Dr. Evil wrote:This should do the trick:Code: Select all
example.com##div.Class1.Class2:not(#tralala)
In my case "tralala" is a variable number (from "p1" to "p99999"), I serched to use a regular expression, but it do not works.
I tried: example.com##div.Class1.Class2:not(#/p\d+/) and many syntax variants, without success (no matches, nothing removed).
Can a regular expression be included like that ?
Thank you
Amy
Re: Mixing regular expression and DIV
Element Hiding Rules are really just CSS Selectors. A reference of all the selectors supported by Firefox can be found here: https://developer.mozilla.org/en/css_re ... electors_2
There's no selector that matches an attribute (like ID) with a regular expression, so the only way to hide the element you're concerned with would be with the "starts with" attribute selector:
Or, in case the page has some ids starting with "p", you'll have to use this rule:
There's no selector that matches an attribute (like ID) with a regular expression, so the only way to hide the element you're concerned with would be with the "starts with" attribute selector:
Code: Select all
example.com##div.Class1.Class2:not([id^="p"])
Code: Select all
example.com##div.Class1.Class2:not([id^="p1"]):not([id^="p2"]):not([id^="p3"]):not([id^="p4"]):not([id^="p5"]):not([id^="p6"]):not([id^="p7"]):not([id^="p8"]):not([id^="p9"])