Simpler way to match domains?
I wanted to match the entire gov domain, but simple constructions like:
*://*.gov/
don't seem to work. Checking through the Advanced Features, I found an example for matching "internationalized domain names":
/^https?:\/\/([^/.]+\.)*?xn--/
Which then could be adapted to block gov:
/^https?:\/\/([^/.]+\.)*?gov/
Is there a simpler way? If so I believe it would be helpful to show it in the help documentation.
You could just use regular expressions, like this /.*\.gov/
You could just use regular expressions, like this
/.*\.gov/
I'mma give that a try, see how it works on my setup.
{To anyone} This one probably needs a regex... What would be a 'simple' way to filter (.com|.gov)(.|ai|io|us) , specific combos like
com.us gov,ai gov.us com.eu
@realAzazello probably this: /.*\.(com|gov|ai|io|us)/
Thanks but not quite it-- I'm looking for filter specifically combos like
com.us gov,ai gov.us com.eu
Thanks but not quite it-- I'm looking for filter specifically combos like
com.us gov,ai gov.us com.eu
I had found a solution for my examples just a few months ago, forgot to share:
# This might not be efficient - but works!
/^https?:\/\/([^/.]+\.)*?com\.(ai|eu|ευ|us)\/(.*)/
/^https?:\/\/([^/.]+\.)*?gov\.(ai|eu|ευ|us)\/(.*)/
Don't know if this can be done simpler.
I wanted to match the entire gov domain, but simple constructions like:
*://*.gov/don't seem to work.
*://*.gov/*
Thanks but not quite it-- I'm looking for filter specifically combos like
com.us gov,ai gov.us com.eu
host =~ /\.(com|gov)\.(ai|eu|us)$/