Repository navigation
Conversation
…one character labels dom_regex missed example.com:8080, www.a.example.com, example.com. and domains followed by , ; : ! or a quote or bracket. The labels are now matched possessively, which also makes the search linear for input like "a.b.a.b..." (80 000 chars: 145 ms before, 5 ms now).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #93.
dom_regexnow finds domains followed by a port, a closing quote or bracket, or, ; : !, domains with one-character labels (only the TLD needs two characters), and drops a trailing FQDN/sentence dot. An HTML entity such as.does not end a domain, sosrc="other.example.com"does not yieldother.example. The labels are matched possessively, which keeps the search linear: on 80 000 chars ofa.b.a.b…it takes 5 ms instead of 145 ms.Tests: 21 new cases in
tests/test_ioc_boundaries.py(15 fail without the change, including negatives likee.g.,a.m.,U.S.A). Full suite and--run-slowperformance tests pass; the one failure,test_get_obfuscated_ip_rejects[12345678901], also fails on master on macOS (inet_aton).