Skip to content

Commit

Permalink
Use non-capturing groups for IPv4 address detection (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotwutingfeng committed Mar 8, 2024
1 parent 6632577 commit 9f16a0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tldextract/remote.py
Expand Up @@ -7,8 +7,9 @@
from urllib.parse import scheme_chars

IP_RE = re.compile(
r"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.)"
r"{3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
r"^(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.)"
r"{3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$",
re.ASCII,
)

scheme_chars_set = set(scheme_chars)
Expand Down

0 comments on commit 9f16a0c

Please sign in to comment.