Aldaviva / content-blocking-filters

🛡 Block ads and other unwanted content on web pages.
Apache License 2.0
7 stars 1 forks source link

Twitter Politics keyword block for elections is also blocking electrical #1

Closed Aldaviva closed 3 years ago

Aldaviva commented 3 years ago

This pattern was originally intended to match words like elect, elects, election, electoral, elected, and electing, but not electric, electrical, electronics, or electron.

Pattern

twitter.com##div[aria-label='Timeline: Your Home Timeline'] > div > div > div:has(div[data-testid='tweet'] > div > div:nth-child(2):has-text(/\belect/i))

Text

electrical

Aldaviva commented 3 years ago

Adding negative lookahead for r at the end of the pattern.

Aldaviva commented 3 years ago

New pattern

/\belect(?!r)/i

Pattern demo

https://regex101.com/r/065cRr/2/