wtfe²日本語

MonkeyUser

Regex Explained

by MonkeyUserPublished:

Read the original ↗

What happens

  1. A developer stands at a whiteboard covered in a long regular expression and starts: "Now, this part of the regex..."
  2. A piece of the expression breaks loose and attacks him. "Oops!"
  3. He bends down to pick up the pieces: "Sorry, bad capture group."
  4. Back at the board, the regex has turned into a row of emoji and symbols. "Now where was I... God damn it!!!"

Read the original ↗

Why it lands

Regular expressions are dense enough that explaining one often changes it. The hover text puts it as a law: how long you can follow a regex is inversely proportional to the square of its capture groups.

Reuse terms: All rights reservedCopyright Monkeyuser 2025. All rights reserved.