Error Terminal command symbol - $

v6.45.3

/ip firewall layer7-protocol
add name=drop_website regexp="^.+(gmail).*$"

When entering such a command, field “Regexp” is empty:

$ is a special char and must be escaped:
https://wiki.mikrotik.com/wiki/Manual:Scripting#Constant_Escape_Sequences

Would this be not more efficient?

“.gmail..*$”

You already hooked it up to the end with $ sign.

It confuses me that Regex is seen as scripting in ROS…

I did everything according to the instructions (link), and it seems to me that the command is not the right one:

regexp="^.(youtube.com|youtu.be|netflix.com|vimeo.com|screen.yahoo.com|dailyMotion.com|hulu.com|twitch.tv|liveleak.com|vine.co|break.com|tv.com|metacafe.com|viewster.com).*$"

If I understand you correctly, it should be like this:

regexp="^.(youtube.com|youtu.be|netflix.com|vimeo.com|screen.yahoo.com|dailyMotion.com|hulu.com|twitch.tv|liveleak.com|vine.co|break.com|tv.com|metacafe.com|viewster.com).*\$"

This works, but not sure if parentheses () are needed, and is the $ character needed at the end

I am using Regex for domain names very often and you have anchor it at the beginning of the domain (^) or at the end ($ (in ROS $)). If you don’t anchor them then it can match any part of the domain name. The group is used for more complex Regex matching and not needed here.

Better, grouping is correct here and it needs a subdomain (“www” is also a subdomain). If you want also to block the main domain (youbube.com) then use (^|.) at the beginning.

Subdomains and domains:

regexp="(^|\.)(youtube.com|youtu.be|netflix.com|vimeo.com|screen.yahoo.com|dailyMotion.com|hulu.com|twitch.tv|liveleak.com|vine.co|break.com|tv.com|metacafe.com|viewster.com)\$"