RegexWars
Tier 2 · Archmagematch

The Line Without It

Match a line that does not contain the word "ERROR" anywhere in it.

Everyone reaches for [^ERROR] first, and it is the most expensive misconception in regex. [^...] is a character CLASS: it matches ONE character that is not E, not R and not O — so it rejects "INFO server started" for the O in INFO, while happily matching the single letter "x" inside a line full of ERRORs. There is no "not this word" operator. What you need is a tempered dot: check at every position that the word does not start here, then consume one character — (?:(?!ERROR).)* — repeated across the whole line, anchored end to end so the check really does cover all of it. Negation in regex is a claim about every position, not about a character.

Your pattern0 chars · par 17
//
Flags
Start typing — tests run as you go.0 of 5 visible tests passing
Test cases
  • INFO server startedmust match
  • WARN disk almost fullmust match
  • an error occurredmust match

    lower case — a different word

  • ERROR connection refusedmust not match
  • 2026-08-13 ERROR timeoutmust not match

    the word is in the middle, not the start

+ 10 hidden tests, checked when you submit. They are what stops a pattern that only fits the examples above.