amitbl / blocktube

YouTube™ content blocker
GNU General Public License v3.0
912 stars 66 forks source link

[Question] What works in regex and what doesn't? #328

Open levicki opened 1 year ago

levicki commented 1 year ago

I wanted to block all videos starting with a number between one and three digits so I tried this:

/^\d{1,3}.*$/

But that doesn't work. On the other hand putting just:

/\d+/

Works, but it blocks all titles containing any number of digits at any position.

If you are wondering what I am trying to do it is to block lists of things (11 most faked foods, 5 things to do on your vacation, 10 best cars, etc).

cobaltdr commented 1 year ago

/^\d{1,3}./gm

achieves what you require. Tested with https://regex101.com