question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IPv6 regex matches on "::"

See original GitHub issue
Matched on: ::
Name: Internet Protocol (IP) Address Version 6
Link:  https://www.shodan.io/host/::

This shouldn’t match.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SkeletalDemisecommented, Oct 12, 2021

I think we should remove :: 😃

What do you mean by that? We can’t remove all instances of :: because then the IPv6 regex won’t work.

1reaction
SkeletalDemisecommented, Oct 13, 2021

I doubt the IPv6 address regex will 100% break if we ask it to not match things which are 2 characters

Sorry I got confused and thought you meant removing all instances of :: and not just :: by itself.

Why not? :: will also match on things like Dictionary::Entry::Point which is not an ipv6 address. It has too many false positives and isn’t helpful.

Now I’m confused again. :: is used in IPv6 addresses. See here.

Also, please explain why it won’t work in the future instead of making me ask you why 😃 Saves a lil bit of time / effort ! 😃

The reason it wouldn’t work is because some IPv6 addresses use :: in them and the regex wouldn’t match those.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regular expression that matches valid IPv6 addresses
This regular expression will match valid IPv6 and IPv4 addresses in accordance with GNU C++ implementation of regex with REGULAR EXTENDED mode ...
Read more >
8.17. Matching IPv6 Addresses - Regular Expressions ...
Match an IPv6 address in standard notation, which consists of eight 16-bit words using hexadecimal notation, delimited by colons (e.g.: ...
Read more >
Regex for ip address(ipv6) - iHateRegex
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol. This is used to provide identification for devices in...
Read more >
A Regular Expression for IPv6 Addresses - Fortra Community
Stephen Ryan at Dartware has produced a regular expression (regex) that can be used to match any legal format of an IPv6 address....
Read more >
Match IPv6 Address - Regex Tester/Debugger
Regular Expression to This regex matches IPv6 addresses.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found