FauxPseudo @lemmy.world
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*$"
316 4 ReplyYIj54yALOJxEsY20eU @lemm.ee Lord have mercy
107 0 ReplyDanny M @lemmy.escapebigtech.info 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).
85 2 ReplyEmma_Gold_Man @lemmy.dbzer0.com And dupe check. 0.0.0.0 and 000.000.000.000 may both be valid, but they resolve the same
11 0 Reply
MsPenguinette @lemmy.world IPv6 was a mistake. We should have just added an addition octet
59 8 ReplyCentillionaire @kbin.social 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.
76 1 ReplyNalivai @discuss.tchncs.de Oh yeah, great, let's change the fundamental protocol on which all the networks in the world are based. Now two third of the devices in the world crashed because you tried to ping 192.168.0.0.1
17 0 Replysnor10 @lemm.ee They played us for absolute fools!
6 0 Replylnee @lemm.ee IPv
heared of ipv5?
1 0 ReplyFauxPseudo @lemmy.world
Plus the MAC address
1 0 Reply
rob64 @startrek.website Patches @sh.itjust.works Made that joke in an interview once.
They didn't think it was funny. They truly thought Regex was the solution to, but never the cause of, all problems.
They wanted to make a Regex to verify every single address in the world. Dodged a bullet
20 0 Reply
BeigeAgenda @lemmy.ca
It's always a treat to debug a regex of that size.
31 0 ReplySchizoDenji @lemm.ee I knew there would be someone with the regex.
29 0 Replytakeda @lemmy.world You're more of a perl programmer than network engineer :P
18 0 Replyhemko @lemmy.dbzer0.com .*
4 0 ReplyTrailblazing Braille Taser @lemmy.dbzer0.com Technically, this one also matches everything:
2 0 Reply
shootwhatsmyname @lemm.ee
*exits the room*
3 0 Reply
Static_Rocket @lemmy.world
0.0.0.0/0 0::0/0
You didn't specify it couldn't be in CIDR block notation...
177 0 ReplyRedjard @lemmy.dbzer0.com
::/0
27 0 ReplyMr_Dr_Oink @lemmy.world Remember, when we abbreviate an ipv6 address all leading zeros are reduced to a single 0.
E.g
0003 would just become 03
When there are geoups of 4 zeros these can be represented as a single 0 or as a double colon ::
But we can only use the :: once so when summarizing an address containing multiple groups of 4 0s one after the other they can all be abbreviated to a single ::
Eg
fe80:0000:0000:0000:0210:5aff:feaa:20a2 would become fe80::210:5aff:feaa:20a2
Therefore it is perfectly valid to abbreviate an address of 0000:0000:0000:0000:0000:0000:0000:0000 /0 to just ::/0
7 0 ReplyStatic_Rocket @lemmy.world
Eh, I've seen some software internally prefer 0::0 instead of just ::0 or :: . Notation wise though you are correct, it is unnecessary.
2 0 Reply
Mr_Dr_Oink @lemmy.world 0.0.0.0 /0 ::/0
SUCK MY DICK, GRU!
91 0 ReplyKairuByte @lemmy.dbzer0.com
Haha spot on
4 0 ReplyJimmyeatsausage @lemmy.world This is the way.
3 2 Reply
agilob @programming.dev
:00
-:ff
Edit: Just learnt this can be also noted as:
::
-::f
83 1 Replyglibg10b @lemmy.ml What about IPv4
5 0 Reply
penguintrinity @discuss.tchncs.de 0.0.0.0/0
68 0 ReplyEmma_Gold_Man @lemmy.dbzer0.com Better hope the goon hasn't heard of IPv6 either, or you're toast
21 0 Replyoatscoop @midwest.social
::/0
22 0 Reply
kase @lemmy.world Undefined
1 1 Reply
🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮 🏆 @yiffit.net
This is gonna take a while...
0.0.0.0
0.0.0.1
0.0.0.2
0.0.0.3
...
66 1 ReplyBoofStroke @lemm.ee
0.0.0.0/0
::/0
42 0 ReplyManifish_Destiny @lemmy.world Winrar
3 0 ReplyDlayknee @lemmy.world Chicken dinrar?
5 0 Reply
rez_doggie @lemmy.world 0.0.0.0/0
40 0 Replydan @upvote.au
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 😂
27 0 Replycoloredgrayscale @programming.dev Heard about that too! Is there an updated version for ipv6?
6 0 Replyspuncertv @iusearchlinux.fyi That file would be ungodly large. There are 2^128 possible addresses, each weighing in at 128 bits, 16 bytes. 16 bytes times 340 trillion trillion trillion. That puts us around 5.44 trillion Zettabytes. The estimates I've seen for worldwide data storage sit aroun 60-70 zettabytes.
10 0 Replydan @upvote.au
IPv6 version is just a Python script that generates random 128-bit integers. Eventually you'll hit a valid IPv6 address!
5 0 Reply
doctorcrimson @lemmy.today 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]
27 0 ReplyHobo @lemmy.world This excludes all the ipv4 ips that have a 0 in the 2nd, 3rd, and 4th octets. Sorry but we're going to have to revoke your Network Engineering credentials.
15 0 Replydoctorcrimson @lemmy.today thanks, fixed
3 0 Reply
tabularasa @lemmy.world Not to nitpick, but an IPv6 address is represented as eight groups of four hexadecimal digits separated by :. Like 2001:0db8:3333:4444:5555:6666:7777:8888.
10 0 Replydoctorcrimson @lemmy.today Omg, that's twice now I've messed it up. Fixed.
4 0 Replynephs @lemmygrad.ml I'll leave the regex to validate an ipv6 address as an exercise to the reader.
1 0 Reply
SpasmodicColon [he/him] @hexbear.net
127.0.0.1, I'm an introvert
23 0 Replyshootwhatsmyname @lemm.ee
one of them has a 7 I’m pretty sure
22 0 Replycomrade_pibb [comrade/them] @hexbear.net
wow don't doxx me plz
7 0 Reply
Seasm0ke @lemmy.world 23 1 ReplyGamma @beehaw.org
0.0.0.0/0
21 0 ReplyNapain @lemmy.ml /32
28 8 ReplyZ3k3 @lemmy.world That's only 1 ip (single host)
22 0 Reply
spudwart @spudwart.com
I mean if I name them do I have to own the domain or…
17 0 Replyquinkin @lemmy.world 1 and 0. Some assembly required.
16 0 ReplyMystikIncarnate @lemmy.ca 32 or 128 of them, depending on protocol.
2 0 Reply
018118055 @sopuli.xyz 0/0
15 0 ReplyMonkderZweite @feddit.ch My PC's is now Bob, My router's Billy...
15 0 Replyfootfaults [none/use name] @hexbear.net
0.0.0.0/0
::
12 0 Replyxav @programming.dev I'll start.
0.0.0.1: Sophie
Your turn.
13 1 Replystarman2112 @sh.itjust.works
0.0.0.2 is Bob
5 0 Replytamiya_tt02 @lemmy.world
0.0.0.3 is Clarence
4 0 Reply
voxel @sopuli.xyz
ipv6
11 0 ReplyHiddenLayer5 @lemmy.ml Name every protocol
10 0 ReplyQuazarOmega @lemy.lol - TCP
- UDP
10 0 Replystringere @reddthat.com UDP
I'd love to tell you a joke about UDP but I'll never know if you get it.
13 0 Reply
LemmysMum @lemmy.world 127.0.0.1
11 1 ReplyOpen World @lemmy.world
Heh, you just doxxed yourself
2 0 Reply
DaveedMee @beehaw.org
127.0.0.1
7 0 ReplyDr. Coomer @lemmy.world
t҉̠̙ǵ̣̞̄ͪ͜x̸̱͚̳ͫ͐̑̈ͯͣ̚n̒͌҉͉̦̜̝ͅ @lemmy.tgxn.net
USA sure does have a lot of IPs!
2 0 Reply
superfes @lemmy.world People name IPs outside of DNS, I mean is there like a Susan or a Karen, perhaps a Clark IP?
4 0 ReplyMiddledAgedGuy @beehaw.org 3 0 Replyblakeus12 [he/him] @hexbear.net
s.w.x.y/z
plug it into a 5-dimensional graph and there you go.
3 0 Replyohlaph @lemmy.world Doug
3 0 Reply