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

CodeQuality: Lengthen TLD wildcard matching for regex / repair #13

Merged
merged 1 commit into from Aug 2, 2017

Conversation

krnjn
Copy link
Contributor

@krnjn krnjn commented Aug 2, 2017

What
There are a few cases where longer TLDs are needed beyond the initial 4 characters
we allow. A list of all available domain names can be found using:

curl -s http://data.iana.org/TLD/tlds-alpha-by-domain.txt | tail -n+2 | awk '{ print length(), $0 | "sort -n" }'

via the terminal (right now longest is 24, so set it to that).

Same list is avail here: https://jasontucker.blog/8945/what-is-the-longest-tld-you-can-get-for-a-domain-name

**What**
There are a few cases where longer TLDs are needed beyond the initial 4 characters
we allow. A list of all available domain names can be found using:

`curl -s http://data.iana.org/TLD/tlds-alpha-by-domain.txt | tail -n+2 | awk '{ print length(), $0 | "sort -n" }'`

via the terminal (right now longest is 24, so set it to that).
@mockdeep mockdeep merged commit b1fe82c into master Aug 2, 2017
@mockdeep mockdeep deleted the kj-longer-tlds branch August 2, 2017 23:51
@krnjn
Copy link
Contributor Author

krnjn commented Aug 2, 2017

@@ -45,7 +45,7 @@ def self.repair(email)
.gsub(/\s/, '')
.sub(/@+/, '@')
.sub(/\.c0m$/, '.com')
.sub(/,[a-z]{2,4}$/) { |m| m.sub(',', '.') }
.sub(/,[a-z]{2,24}$/) { |m| m.sub(',', '.') }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a more precise check at some point, but this will do.

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

Successfully merging this pull request may close these issues.

None yet

2 participants