top 50 comments

sorted by: hot top controversial new old
[–] 313 points 2 years ago (10 children)

Ok. This covers every ipv6 and ipv4 address.

"^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?\s*$"

  • source
  • hideshow 17 child comments
  • [–] 83 points 2 years ago* (1 child)

    Please don't. Use regex to find something that looks like an IP then build a real parser. This is madness, its's extremely hard to read and a mistake is almost impossible to spot. Not to mention that it's slow.

    Just parse [0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3} using regex (for v4) and then have some code check that all the octets are valid (and store the IP as a u32).

  • source
  • parent
  • hideshow 2 child comments
  • [–] 51 points 2 years ago (5 children)

    IPv6 was a mistake. We should have just added an addition octet

  • source
  • parent
  • hideshow 7 child comments
  • [–] 75 points 2 years ago (5 children)

    That would allow for like, 2 trillion devices? Feels like a bandaid, my dude. Next you’re gonna suggest a giant ice cube in the ocean once a year to stop global warming.

  • source
  • parent
  • hideshow 7 child comments
  • load more comments (3 replies)
  • load more comments (3 replies)
  • [–] 37 points 2 years ago (1 child)
  • load more comments (3 replies)
    [–] 177 points 2 years ago (3 children)

    0.0.0.0/0 0::0/0

    You didn't specify it couldn't be in CIDR block notation...

  • source
  • hideshow 4 child comments
  • load more comments (2 replies)
    [–] 91 points 2 years ago (4 children)

    0.0.0.0 /0 ::/0

    SUCK MY DICK, GRU!

  • source
  • hideshow 4 child comments
  • load more comments (4 replies)
    [–] 82 points 2 years ago* (last edited 2 years ago) (1 child)

    :00 - :ff

    Edit: Just learnt this can be also noted as:

    :: - ::f

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 68 points 2 years ago (2 children)
  • load more comments (1 reply)
    [–] 65 points 2 years ago*

    This is gonna take a while...

    0.0.0.0

    0.0.0.1

    0.0.0.2

    0.0.0.3

    ...

  • source
  • [–] 42 points 2 years ago* (2 children)
    load more comments (2 replies)
    [–] 40 points 2 years ago
    [–] 27 points 2 years ago* (3 children)

    This reminds me of something I saw online maybe 20 years ago now. Someone created a torrent with a name like "every IP address ever (hacking tool)" and uploaded it to Suprnova, which ended up having thousands of people seeding it. It was just a text file with every IPv4 from 0.0.0.0 to 255.255.255.255 😂

  • source
  • hideshow 3 child comments
  • load more comments (3 replies)
    [–] 27 points 2 years ago* (last edited 2 years ago) (2 children)

    ipv4 [0,255].[0,255].[0,255].[0,255]

    ipv6 [0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]:[0000,ffff]

  • source
  • hideshow 4 child comments
  • [–] 23 points 2 years ago

    127.0.0.1, I'm an introvert

  • source
  • [–] 22 points 2 years ago (1 child)

    one of them has a 7 I’m pretty sure

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 22 points 2 years ago
    [–] 21 points 2 years ago
    [–] 20 points 2 years ago (1 child)
  • [–] 17 points 2 years ago

    I mean if I name them do I have to own the domain or…

  • source
  • [–] 16 points 2 years ago (1 child)

    1 and 0. Some assembly required.

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 15 points 2 years ago* (last edited 2 years ago)

    My PC's is now Bob, My router's Billy...

  • source
  • [–] 15 points 2 years ago
    [–] 12 points 2 years ago (4 children)

    I'll start.

    0.0.0.1: Sophie

    Your turn.

  • source
  • hideshow 4 child comments
  • load more comments (4 replies)
    [+] 12 points 2 years ago* (last edited 2 years ago)
    [–] 11 points 2 years ago
    [–] 10 points 2 years ago (1 child)
  • [–] 10 points 2 years ago (1 child)
    load more comments (1 reply)
    load more comments
    view more: next ›