Elon Musk’s X botched an attempt to replace “twitter.com” links with “x.com”
Elon Musk’s X botched an attempt to replace “twitter.com” links with “x.com”

Elon Musk’s X botched an attempt to replace “twitter.com” links with “x.com”

Elon Musk’s X botched an attempt to replace “twitter.com” links with “x.com”
Elon Musk’s X botched an attempt to replace “twitter.com” links with “x.com”
Regex is hard y'all
Well, they can be, but fucking this particular one up took outright ineptitude
Jobs finished boss
It’s really not though. It’s actually pretty simple under the hood.
But something that you should probably be able to figure out over the course of 12 months of development and testing.
actually url/uri spec is surprisingly complex, I'm not even sure it's possible to fully/correctly match it with regex without false positives or negatives, especially in twitters case where even things like "google.com" are accepted as valid urls (without the protocol part, which is otherwise mandatory)