Skip to content

Instantly share code, notes, and snippets.

Last active Feb 18, 2020
What would you like to do?
Regular expression to find government domains for websites / email addresses
# regex to match government emails. Should detect:
# note: foo.gouvt, foo.gc,, etc. will technically pass, but they are invalid domains
regex = /(\.g[ou]{1,2}(v|b|vt)|\.mil|\.gc|\.fed)(\.[a-z]{2})?$/i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment