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

valid domain return an invalid error #95

Closed
chenrui opened this issue Oct 10, 2018 · 2 comments · Fixed by #231
Closed

valid domain return an invalid error #95

chenrui opened this issue Oct 10, 2018 · 2 comments · Fixed by #231
Labels
bug Issue: Works not as designed

Comments

@chenrui
Copy link

chenrui commented Oct 10, 2018

Inputting a valid domain name "ktbooks.1.v77.faidns.com", I received a invalid domain error. A domain name can include only one digit between 2 dots. So the pattern could be changed like this:

pattern = re.compile(
r'^(:?(([a-zA-Z0-9]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|' # domain pt.1
r'([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|' # domain pt.2
r'([a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])).)+' # domain pt.3
r'([a-zA-Z]{2,13}|(xn--[a-zA-Z0-9]{2,30}))$' # TLD
)

@marmeladema
Copy link

I have the same problem. I use this module to parse domains from ads/malware delivery lists and indeed a of lot of them contain just a digit between two dots:

  • us.2.cqcounter.com
  • ms127.0.0.101341.club
  • 1.adbrite.com

@marmeladema
Copy link

I created a PR #114 with @chenrui proposed fix.
Do you think it can be merged @kvesteri?

Dan-at-Extrahop added a commit to ExtraHop/threat-intelligence-toolkit that referenced this issue Mar 29, 2019
@yozachar yozachar added the bug Issue: Works not as designed label Mar 2, 2023
yozachar added a commit to yozachar/pyvalidators that referenced this issue Mar 2, 2023
- Uses type hints, improve docs
- Regards [RFC 1034](https://www.rfc-editor.org/rfc/rfc1034)
- Updates corresponding test functions

**Related items**

*Issues*

- Closes python-validators#52
- Closes python-validators#74
- Closes python-validators#81
- Closes python-validators#89
- Closes python-validators#95
- Closes python-validators#120
- Closes python-validators#124
- Closes python-validators#141
- Closes python-validators#143
- Closes python-validators#199
- Closes python-validators#204

*PRs*

- Closes python-validators#114
yozachar added a commit to yozachar/pyvalidators that referenced this issue Mar 2, 2023
- Uses type hints, improve docs
- Regards [RFC 1034](https://www.rfc-editor.org/rfc/rfc1034) and [RFC 2782](https://www.rfc-editor.org/rfc/rfc2782)
- Updates corresponding test functions

**Related items**

*Issues*

- Closes python-validators#52
- Closes python-validators#74
- Closes python-validators#81
- Closes python-validators#89
- Closes python-validators#95
- Closes python-validators#120
- Closes python-validators#124
- Closes python-validators#141
- Closes python-validators#143
- Closes python-validators#199
- Closes python-validators#204

*PRs*

- Closes python-validators#114
- Closes python-validators#179
yozachar added a commit to yozachar/pyvalidators that referenced this issue Mar 2, 2023
- Uses type hints, improve docs
- Regards [RFC 1034](https://www.rfc-editor.org/rfc/rfc1034) and [RFC 2782](https://www.rfc-editor.org/rfc/rfc2782)
- Updates corresponding test functions

**Related items**

*Issues*

- Closes python-validators#52
- Closes python-validators#74
- Closes python-validators#81
- Closes python-validators#89
- Closes python-validators#95
- Closes python-validators#120
- Closes python-validators#124
- Closes python-validators#141
- Closes python-validators#143
- Closes python-validators#199
- Closes python-validators#204

*PRs*

- Closes python-validators#114
- Closes python-validators#179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue: Works not as designed
Projects
None yet
3 participants