TechEarl

40 There Are Two Types of People: Regex Edition

40 'There are two types of people' jokes about regex: those who have one problem vs those who now have two, greedy matching, escaping backslashes, and parsing HTML with regex.

Ishan Karunaratne⏱️ 2 min readUpdated
Share thisCopied
Regex 'there are two types of people' jokes: one problem vs two problems, greedy matching, escaping backslashes, lookaheads, and parsing HTML with regex.

What are "There are two types of people" jokes? They are a humor format that contrasts two opposite types or habits in one line, opening with "there are two types of people" (and, in regex, the one who now has two problems).

40 There Are Two Types of People: Regex Edition

There are two types of people: those who had a problem and used regex, and those who now have two problems.

There are two types of people: those who understand the regex they wrote, and those who wrote it six months ago.

There are two types of people: those who escaped the dot, and those matching every character and wondering why.

There are two types of people: those who use non-greedy matching, and those whose pattern ate the entire document.

There are two types of people: those who tested the regex, and those who shipped it and broke every email with a plus sign.

There are two types of people: those who parse HTML with a parser, and those who tried it with regex and summoned something.

There are two types of people: those who write a readable regex, and those who wrote 200 characters of line noise and called it done.

There are two types of people: those who comment their regex, and those who left a curse for future-you.

There are two types of people: those who anchor with ^ and $, and those matching in the middle of words by accident.

There are two types of people: those who finally got the regex working, and those who refuse to touch it ever again.

There are two types of people: those who write the regex, and those who copy it from Stack Overflow and pray.

There are two types of people: those who validate email with a simple pattern, and those who found the 6,000-character "correct" one and lost it.

There are two types of people: those who use a regex tester, and those debugging in production with real user data.

There are two types of people: those who use named groups, and those counting parentheses out loud.

There are two types of people: those who reached for regex, and those who realized a split would have done it.

There are two types of people: those who learned lookaheads, and those who pretend lookaheads do not exist.

There are two types of people: those who escaped the backslash, and those staring at four of them wondering how many they need.

There are two types of people: those who use word boundaries, and those matching "cat" inside "category" forever.

There are two types of people: those who know the difference between a digit class and \d, and those who used both in one pattern.

There are two types of people: those who set the right flags, and those wondering why it only matches the first line.

There are two types of people: those who break the regex into pieces, and those with one expression you can see from space.

There are two types of people: those who handle Unicode, and those whose pattern works until someone types an accent.

There are two types of people: those who reuse a tested pattern, and those who rewrite it slightly worse every time.

There are two types of people: those who guarded against catastrophic backtracking, and those who took the server down with one input.

There are two types of people: those who say "I'll just use regex," and those who said that yesterday.

There are two types of people: those who read the regex docs, and those guessing at syntax until something matches.

There are two types of people: those who match phone numbers loosely, and those building one pattern for all 200 countries at once.

There are two types of people: those who quoted the special characters, and those whose dot matched the whole input.

There are two types of people: those who test against the data, and those who tested against their hopes.

There are two types of people: those who keep the regex simple, and those who added a third lookbehind at 1 a.m.

There are two types of people: those who explain the pattern in a comment, and those who wrote "good luck."

There are two types of people: those who use a library for dates, and those parsing dates with regex and crying.

There are two types of people: those who escaped the slash in the URL pattern, and those whose regex ended early at the first one.

There are two types of people: those who use a whitespace class, and those who typed a literal space and missed all the tabs.

There are two types of people: those who write a test for the regex, and those who will find out from the support ticket.

There are two types of people: those who learned regex once, and those who relearn it every single time.

There are two types of people: those who can read a regex aloud, and those who go quiet and squint.

There are two types of people: those who know flavors differ, and those whose pattern works in JavaScript and dies in grep.

There are two types of people: those who tested the edge cases, and those whose regex works on the one example they had.

There are two types of people: those who matched what they meant, and those who matched everything and called it a feature.

See also

Sources

Authoritative references this article was fact-checked against.

TagsHumorJokesThere Are Two Types of PeopleRegExProgrammingDevelopers

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Tech Architect · Software Engineer · AI/DevOps

Tech architect and software engineer with 20+ years building software, Linux systems, and DevOps infrastructure, and lately working AI into the stack. Currently Chief Technology Officer at a healthcare tech startup, which is where most of these field notes come from.

Keep reading

Related posts