Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpler way to match domains? #552

Open
pjmattingly opened this issue Nov 19, 2024 · 4 comments
Open

Simpler way to match domains? #552

pjmattingly opened this issue Nov 19, 2024 · 4 comments

Comments

@pjmattingly
Copy link

pjmattingly commented Nov 19, 2024

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.

@laylavish
Copy link

You could just use regular expressions, like this /.*\.gov/

@realAzazello
Copy link

realAzazello commented Nov 24, 2024

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

@laylavish
Copy link

@realAzazello probably this: /.*\.(com|gov|ai|io|us)/

@realAzazello
Copy link

Thanks but not quite it-- I'm looking for filter specifically combos like

com.us
gov,ai
gov.us
com.eu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants