Can someone help me with Regex code?

tazarbm

Elite Member
Executive VIP
Jr. VIP
Joined
Oct 28, 2020
Messages
11,663
Reaction score
14,635
Hi,

I'm trying to make my Brave browser stop autoplaying youtube videos, and I thought that by blocking "youtube.com" in the autoplay exceptions list (or whatever it's called, I don't remember) then all YT clips will stop being autoplayed. But, unfortunately, this only works if I left-mouse click on a YT video. If I right-mouse click on it to open it in a new tab (which I do most of the time) then it starts autoplaying as soon as I switch over to that tab from my current tab. And this sucks.

So, I would like to add a regex formula inside of the Brave's autoplay blocking list that stops all youtube vids that contain this string "youtube.com/watch?v=" but I can't figure out what the right Regex code for this is because I'm not good with regex. Can some Regex magician spoon-feed me the right code?

Please note that after the "=" sign in the above formula a new string of characters will follow, and this is where Regex comes in because each YT clip has a different string of characters after the "=" sign - as you can probably already know - and that string is always different, so the Regex formula would obviously have to block any string of characters that follows the "=" sign, regardless of its composition.

I did try using both these pieces of code, but neither worked:

Code:
[*.]youtube.com[/*]
[*.]youtube.com/[*]

So yeah, I don't know what to use, so I'm hoping that you, freaks.... I mean, gods (definitely GODS of regex :D) can help.
 
Dont know if this help but this will match string between "=" and "something"
Code:
(?<==)(.*?)(?=something)
 
Try something like
Code:
/youtube\.com\/watch\?v=/
Lemme know if it doesn’t work. ps, also try with removing the / from beginning and end, if it doesn’t work. I dunno how brave takes the regex.
 
Why not just...

youtube.com\/.*
or
youtube.com\/watch\?v=.*

You can play/test around with everyone's commands here:
https://regex101.com/
I recommend that you try the 2nd one (youtube.com\/watch\?v=.*)
 
Last edited:
Dont know if this help but this will match string between "=" and "something"
Code:
(?<==)(.*?)(?=something)

Try something like
Code:
/youtube\.com\/watch\?v=/
Lemme know if it doesn’t work. ps, also try with removing the / from beginning and end, if it doesn’t work. I dunno how brave takes the regex.

youtube[.]com\/watch\?v=

above code will work

Why not just...

youtube.com\/.*
or
youtube.com\/watch\?v=.*

You can play/test around with everyone's commands here:
https://regex101.com/
I recommend that you try the 2nd one (youtube.com\/watch\?v=.*)

Thanks to everyone who tried helping. Unfortunately, none of the codes work, and this makes me wonder whether Regex is even allowed in that field. I assumed that Regex is allowed because the placeholder that Brave provides is [*.]example.com and the [*.] part looks like Regex to me, so I assumed that they do allow Regex.

But none of these codes works, I can't even save the input because Brave automatically detects it as "not a valid web address" :)
 
Thanks to everyone who tried helping. Unfortunately, none of the codes work, and this makes me wonder whether Regex is even allowed in that field. I assumed that Regex is allowed because the placeholder that Brave provides is [*.]example.com and the [*.] part looks like Regex to me, so I assumed that they do allow Regex.

But none of these codes works, I can't even save the input because Brave automatically detects it as "not a valid web address" :)
hmmm what if you used

Code:
https://youtube.com/watch?v=[*.]
?
 
hmmm what if you used

Code:
https://youtube.com/watch?v=[*.]
?
it automatically removes everything after .com
 
Back
Top