An ipv6 address turns my brains thinking center off. Short circuit at how fucking stupid it looks.
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
No different the 10.A4.b2.12
https://en.m.wikipedia.org/wiki/Internet_Stream_Protocol
In case anyone wants to know what not to talk about.
I wrote and ipv6 parser once.
Never again.
As in a regex or ..?
An ipv4 parser would also be sorta difficult.
you have to account for the fact that all the octets can be added to decimal: http://2130706433 (valid 127.0.0.1)
or the fact that octets can be in different formats: http://0x7F.0x0.0x0.0x1 (127.0.0.1)
or the fact that you can mix octet formats: http://0xC0.0250.0.1 (192.168.0.1)
Yeah a mix of regex and heuristics to validate before parsing
It was a long time ago now
It also had to parse ipv4 because they can be embedded (IIRC) and the different octet formats