Logo
Ship my machine, not my code.
  • Home
  • Hot
  • Random
  • Search

Browse

  • AI AI
  • AWS AWS
  • Agile Agile
  • Algorithms Algorithms
  • Android Android
  • Apple Apple
  • Backend Backend
  • Bash Bash
  • C++ C++
  • Cloud Cloud
  • Csharp Csharp
  • All Categories
As an Amazon Associate ProgrammerHumor.io earns from qualifying purchases.

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

Lazy quantifiers Memes

Posts tagged with Lazy quantifiers

Stop Doing Regex: The Keyboard Smashing Cult

Programming Javascript Debugging Testing Frontend
1 year ago 415.7K views 0 shares
Stop Doing Regex: The Keyboard Smashing Cult
The regex rebellion is here, and it's about time! Developers have been suffering through arcane incantations like \A(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\z just to validate an email address, when all we really wanted was to check if someone typed something with an @ symbol. The try-catch joke is brilliant because it's painfully true - we've been using error handling as regex therapy. "Let's wrap this eldritch horror in a try-catch and hope the stack trace is less traumatizing than debugging the pattern." And those lazy quantifiers? Nothing lazy about spending 3 hours figuring out why your greedy pattern is consuming the entire document. The real joke is that after all these years, we're still writing regex that looks like someone headbutted the keyboard while holding shift. Next time someone asks you to validate a phone number with regex, just respond with "Hello I would like an\d\sapples? please" and walk away dramatically.

Today's picks

UGREEN 20Gbps M.2 NVMe SATA SSD Enclosure Compatible with 10Gbps USB C External M.2 Enclosure USB 3.2 Gen2 Support UASP Trim for M/B+M Key NVMe and SATA SSD in Size of 2230/2242/2260/2280

UGREEN 20Gbps M.2 NVMe SATA SSD Enclosure Compatible with 10Gbps USB C External M.2 Enclosure USB 3.2 Gen2 Support UASP Trim for M/B+M Key NVMe and SATA SSD in Size of 2230/2242/2260/2280

Affiliate
$31.99
Average PM Energy

Average PM Energy

Agile
252.7K views 5 months ago
Nothing Just Practise

Nothing Just Practise

Programming
70.1K views 2 years ago