Examples of Regex So Bad They Make Us Question Our Life Choices

A collection of regular expressions that are more complicated than they need to be

Example 1: A Regular Expression to Match All Occurrences of the Word "Hello" Except When it's Used as a Greeting

(^|hello\s*\(?|hello\s*[^a-zA-Z0-9]hello\s*)

Example 2: A Regular Expression to Match All Occurrences of the Word "World" Except When it's Used as a Metaphor for Global Domination

world(?-u[ prophets| of| of| Warlords| of| of| of| of)

Example 3: A Regular Expression to Match All Occurrences of the Letter "E" Except When it's Used to Form a Perfectly Good Word

^[a-zA-Z](?![Ee| E| E| E| E| E]