Filtering rules documentation

Discussion in 'Custom Filters' started by avatar, Sep 21, 2016.

  1. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    13,144
    Hey all!

    We have updated the documentation on the filtering rules syntax:
    https://adguard.com/en/filterrules.html

    Finally, we have a detailed and comprehensive article covering all Adguard capabilities. It is important to note, that creating of your own filtering rules requires some knowledge of web technologies, such as HTML, CSS and Javascript.


    Helpful links:

    Helpful tools:
     
    aegis and Adam like this.
  2. Adam

    Adam Filters Developer Staff Member Moderator

    Joined:
    Aug 17, 2014
    Messages:
    1,456
    aegis likes this.
  3. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    13,144
    Ops, thank you for pointing at it!
     
  4. SlowMemory

    SlowMemory Beta Tester

    Joined:
    Sep 20, 2015
    Messages:
    475
    It seems that $ should be escaped in the replace example.
    Untitled.png
    +)
    in https://adguard.com/en/filterrules.html#replace-modifier
    Code:
    ://*.damoh.golem.de/$replace=/(<VAST(.|\s)*?>)(.|\s)*<\/VAST>/$1<\/VAST>/i,domain=video.golem.de
    
    in German filter:
    Code:
    ://*.damoh.golem.de/$replace=/(<VAST[\s\S]*?>)[\s\S]*<\/VAST>/\$1<\/VAST>/,domain=video.golem.de
    
     
    Last edited: Sep 23, 2016
  5. vasily_bagirov

    vasily_bagirov Administrator Staff Member Administrator

    Joined:
    Jul 1, 2014
    Messages:
    6,905
    No, it's fine, the regexp starts after '$replace'.
     
  6. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    13,144
    We've just updated the documentation, thank you!
     
  7. Bruno

    Bruno Member

    Joined:
    Oct 26, 2015
    Messages:
    418
    hi.

    Is it right to say that both rules below will have the same effect - blocking the URL -, meaning both syntax are correct?
    Code:
    ||1dollarcash.com^
    0.0.0.0 1dollarcash.com
    Thanks for the help.
     
  8. Blaz

    Blaz Moderator & Translator Staff Member Moderator

    Joined:
    Dec 21, 2014
    Messages:
    9,882
    2nd one is hosts file syntax. Use first one.
     
    Bruno likes this.
  9. Bruno

    Bruno Member

    Joined:
    Oct 26, 2015
    Messages:
    418
    Thanks.

    BTW, do you think is it better to add the rule in Adguard or Host file then?
     
  10. Blaz

    Blaz Moderator & Translator Staff Member Moderator

    Joined:
    Dec 21, 2014
    Messages:
    9,882
    Better to AdGuard in case some site gets useful content from it you can whitelist that url for that site then.
     
    Bruno likes this.
  11. Bruno

    Bruno Member

    Joined:
    Oct 26, 2015
    Messages:
    418